KickJava   Java API By Example, From Geeks To Geeks.

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


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 18, 2005
11  * Time: 7:58:28 PM
12  */

13 public class TextField extends UIBean {
14     /**
15      * The name of the default template for the TextFieldTag
16      */

17     final public static String JavaDoc TEMPLATE = "text";
18
19     //~ Instance fields ////////////////////////////////////////////////////////
20

21     protected String JavaDoc maxLength;
22     protected String JavaDoc readonly;
23     protected String JavaDoc size;
24
25     public TextField(OgnlValueStack stack, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
26         super(stack, request, response);
27     }
28
29     protected String JavaDoc getDefaultTemplate() {
30         return TEMPLATE;
31     }
32
33     protected void evaluateExtraParams() {
34         super.evaluateExtraParams();
35
36         if (size != null) {
37             addParameter("size", findString(size));
38         }
39
40         if (maxLength != null) {
41             addParameter("maxlength", findString(maxLength));
42         }
43
44         if (readonly != null) {
45             addParameter("readonly", findValue(readonly, Boolean JavaDoc.class));
46         }
47     }
48
49     public void setMaxLength(String JavaDoc maxLength) {
50         this.maxLength = maxLength;
51     }
52
53     public void setReadonly(String JavaDoc readonly) {
54         this.readonly = readonly;
55     }
56
57     public void setSize(String JavaDoc size) {
58         this.size = size;
59     }
60 }
61
Popular Tags