Button Component Index Conditional

Checkbox
org.apache.tapestry.form.Checkbox
checkbox
 
Description
Provides a HTML checkbox form element <input type="checkbox">. The Checkbox component must be wrapped by a Form.
See Also
Form, Radio, RadioGroup
Parameters
Name Type Direction Required Default Description
selected boolean in-out yes   Indicates whether the checkbox is selected or not. Corresponds to the "checked" HTML attribute.
disabled boolean in no false Controls whether the text field is active or not. If disabled, then any value that comes up when the form is submitted is ignored. Corresponds to the "disabled" HTML attribute.

Body: removed
Informal parameters: allowed
Reserved parameters: "type", "checked", "name"

Examples

Provides a checkbox for the user contact a sales representative.

Contact Sales Rep

<form jwcid="@Form" listener="ognl:listeners.formSubmit">
 <input type="checkbox" jwcid="@Checkbox" selected="ognl:contactRep" disabled="ognl:staff"/> Contact Sales Rep
</form>

<property-specification name="contactRep" type="boolean" persistent="yes"/>
<property-specification name="staff" type="boolean"/>
public abstract class EnquiryPage extends BasePage { public abstract boolean isContactRep(); public abstract void setContactRep(boolean value); public abstract boolean isStaff(); public abstract void setStaff(boolean staff); public void formSubmit(RequestCycle cycle) { if (isContactRep()) { // Process contact a sales representative request } } }

Button Component Index Conditional