KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > components > Submit


1 package com.opensymphony.webwork.components;
2
3 import com.opensymphony.xwork.util.OgnlValueStack;
4
5 import javax.servlet.http.HttpServletRequest JavaDoc;
6 import javax.servlet.http.HttpServletResponse JavaDoc;
7
8 /**
9  * User: plightbo
10  * Date: Jul 20, 2005
11  * Time: 6:46:38 AM
12  */

13 public class Submit extends UIBean {
14     final public static String JavaDoc TEMPLATE = "submit";
15
16     protected String JavaDoc align;
17     protected String JavaDoc resultDivId;
18     protected String JavaDoc onLoadJS;
19     protected String JavaDoc notifyTopics;
20     protected String JavaDoc listenTopics;
21
22     public Submit(OgnlValueStack stack, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
23         super(stack, request, response);
24     }
25
26     protected String JavaDoc 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 JavaDoc align) {
62         this.align = align;
63     }
64
65     public void setResultDivId(String JavaDoc resultDivId) {
66         this.resultDivId = resultDivId;
67     }
68
69     public void setOnLoadJS(String JavaDoc onLoadJS) {
70         this.onLoadJS = onLoadJS;
71     }
72
73     public void setNotifyTopics(String JavaDoc notifyTopics) {
74         this.notifyTopics = notifyTopics;
75     }
76
77     public void setListenTopics(String JavaDoc listenTopics) {
78         this.listenTopics = listenTopics;
79     }
80 }
81
Popular Tags