Examples
Provides a checkbox for the user contact a sales representative.
<form jwcid="@Form" listener="ognl:listeners.formSubmit">
<input type="checkbox" jwcid="@Checkbox" selected="ognl:contactRep" disabled="ognl:staff"/> Contact Sales Rep
</form>
public class EnquiryPage extends BasePage {
private boolean contactRep;
private boolean isStaff;
public boolean getContactRep() { return contactRep; }
public void setContactRep(boolean value) {
contactRep = value;
fireObservedChange("contactRep", contactRep);
}
public boolean isStaff() { return isStaff; }
public void detach() {
contactRep = false;
isStaff = false;
super.detach();
}
public void formSubmit(RequestCycle cycle) {
if (getContactRep()) {
// Process contact a sales representative request
}
}
}
|