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 TextField extends UIBean { 14 17 final public static String TEMPLATE = "text"; 18 19 21 protected String maxLength; 22 protected String readonly; 23 protected String size; 24 25 public TextField(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) { 26 super(stack, request, response); 27 } 28 29 protected String 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 .class)); 46 } 47 } 48 49 public void setMaxLength(String maxLength) { 50 this.maxLength = maxLength; 51 } 52 53 public void setReadonly(String readonly) { 54 this.readonly = readonly; 55 } 56 57 public void setSize(String size) { 58 this.size = size; 59 } 60 } 61 | Popular Tags |