FileDocCategorySizeDatePackage
TextField.javaAPI DocExample3662Mon Jul 23 13:26:36 BST 2007org.apache.struts2.components

TextField

public class TextField extends UIBean
Render an HTML input field of type text

Examples

In this example, a text control for the "user" property is rendered. The label is also retrieved from a ResourceBundle via the key attribute.


<s:textfield key="user" />


<s:textfield name="user" label="User Name" />

Fields Summary
public static final String
TEMPLATE
The name of the default template for the TextFieldTag
protected String
maxlength
protected String
readonly
protected String
size
Constructors Summary
public TextField(com.opensymphony.xwork2.util.ValueStack stack, HttpServletRequest request, HttpServletResponse response)


           
        super(stack, request, response);
    
Methods Summary
protected voidevaluateExtraParams()

        super.evaluateExtraParams();

        if (size != null) {
            addParameter("size", findString(size));
        }

        if (maxlength != null) {
            addParameter("maxlength", findString(maxlength));
        }

        if (readonly != null) {
            addParameter("readonly", findValue(readonly, Boolean.class));
        }
    
protected java.lang.StringgetDefaultTemplate()

        return TEMPLATE;
    
public voidsetMaxLength(java.lang.String maxlength)

        this.maxlength = maxlength;
    
public voidsetMaxlength(java.lang.String maxlength)

        this.maxlength = maxlength;
    
public voidsetReadonly(java.lang.String readonly)

        this.readonly = readonly;
    
public voidsetSize(java.lang.String size)

        this.size = size;