Checkboxpublic class Checkbox extends UIBean
Renders an HTML input element of type checkbox, populated by the specified property from the ValueStack.
Examples
JSP:
<s:checkbox label="checkbox test" name="checkboxField1" value="aBoolean" fieldValue="true"/>
Velocity:
#tag( Checkbox "label=checkbox test" "name=checkboxField1" "value=aBoolean" )
Resulting HTML (simple template, aBoolean == true):
<input type="checkbox" name="checkboxField1" value="true" checked="checked" />
|
Fields Summary |
---|
public static final String | TEMPLATE | protected String | fieldValue |
Methods Summary |
---|
protected void | evaluateExtraParams()
if (fieldValue != null) {
addParameter("fieldValue", findString(fieldValue));
} else {
addParameter("fieldValue", "true");
}
| protected java.lang.String | getDefaultTemplate()
return TEMPLATE;
| protected java.lang.Class | getValueClassType()
return Boolean.class; // for checkboxes, everything needs to end up as a Boolean
| public void | setFieldValue(java.lang.String fieldValue)
this.fieldValue = fieldValue;
|
|