KickJava   Java API By Example, From Geeks To Geeks.

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


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: 8:05:46 AM
12  */

13 public class Checkbox extends UIBean {
14     final public static String JavaDoc TEMPLATE = "checkbox";
15
16     protected String JavaDoc fieldValue;
17
18     public Checkbox(OgnlValueStack stack, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
19         super(stack, request, response);
20     }
21
22     protected String JavaDoc getDefaultTemplate() {
23         return TEMPLATE;
24     }
25
26     protected void evaluateExtraParams() {
27         if (fieldValue != null) {
28             addParameter("fieldValue", findString(fieldValue));
29         }
30     }
31
32     protected Class JavaDoc getValueClassType() {
33         return Boolean JavaDoc.class; // for checkboxes, everything needs to end up as a Boolean
34
}
35
36     public void setFieldValue(String JavaDoc fieldValue) {
37         this.fieldValue = fieldValue;
38     }
39 }
40
Popular Tags