1 package com.opensymphony.webwork.components; 2 3 import com.opensymphony.xwork.util.OgnlValueStack; 4 5 import javax.servlet.http.HttpServletRequest ; 6 import javax.servlet.http.HttpServletResponse ; 7 8 13 public class Submit extends UIBean { 14 final public static String TEMPLATE = "submit"; 15 16 protected String align; 17 protected String resultDivId; 18 protected String onLoadJS; 19 protected String notifyTopics; 20 protected String listenTopics; 21 22 public Submit(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) { 23 super(stack, request, response); 24 } 25 26 protected String getDefaultTemplate() { 27 return TEMPLATE; 28 } 29 30 public void evaluateParams() { 31 if (align == null) { 32 align = "right"; 33 } 34 35 if (value == null) { 36 value = "Submit"; 37 } 38 39 super.evaluateParams(); 40 41 addParameter("align", findString(align)); 42 43 if (null!=resultDivId) 44 addParameter("resultDivId", findString(resultDivId)); 45 46 if (null!=onLoadJS) 47 addParameter("onLoadJS", findString(onLoadJS)); 48 49 if (null!=notifyTopics) 50 addParameter("notifyTopics", findString(notifyTopics)); 51 52 if (null!=listenTopics) 53 addParameter("listenTopics", findString(listenTopics)); 54 55 Form form = (Form) findAncestor(Form.class); 56 if (form != null) { 57 addParameter("formId", ((Form) form).getId()); 58 } 59 } 60 61 public void setAlign(String align) { 62 this.align = align; 63 } 64 65 public void setResultDivId(String resultDivId) { 66 this.resultDivId = resultDivId; 67 } 68 69 public void setOnLoadJS(String onLoadJS) { 70 this.onLoadJS = onLoadJS; 71 } 72 73 public void setNotifyTopics(String notifyTopics) { 74 this.notifyTopics = notifyTopics; 75 } 76 77 public void setListenTopics(String listenTopics) { 78 this.listenTopics = listenTopics; 79 } 80 } 81 | Popular Tags |