Examples
The Conditional component in this example is used to display whether the
person is a manager and if they are a manager whether they have any staff.
John Smith is a Manager with no staff.
| |
<span jwcid="@Insert" value="ognl:fullName"/>
<span jwcid="@Conditional" condition="ognl:manager"> is a Manager
<span jwcid="@Conditional" condition="ognl:staffList.empty"> with staff.</span>
<span jwcid="@Conditional" condition="ognl:! staffList.empty">
with <font color="red"><b>no</b></font> staff.</span>
</span>
<span jwcid="@Conditional" condition="ognl:! manager"> is not a Manager.</span>
public class EnquiryPage extends BasePage {
private String fullName;
private boolean isManager;
private List staffList;
public String getFullName() { return fullName; }
public void setFullName(String value) {
fullName = value;
}
public boolean isManager() { return isManager; }
public void setManager(boolean value) {
isManager = value;
}
public List getStaffList() { return staffList; }
public void setStaffList(List value) {
staffList = value;
}
public void detach() {
fullName = null;
isManager = false;
staffList = null;
super.detach();
}
}
|