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="insertName"/>
<span jwcid="ifManager"> is a Manager
<span jwcid="ifHasStaff"> with staff.</span>
<span jwcid="ifNotHasStaff">
with <font color="red"><b>no</b></font> staff.</span>
</span>
<span jwcid="ifNotManager"> is not a Manager.</span>
<component id="insertName" type="Insert">
<binding name="value" expression="fullName"/>
</component>
<component id="ifManager" type="Conditional">
<binding name="condition" expression="manager"/>
</component>
<component id="ifNotManager" type="Conditional">
<binding name="condition" expression="manager"/>
<static-binding name="invert">true</static-binding>
</component>
<component id="ifHasStaff" type="Conditional">
<binding name="condition" expression="staffList.empty"/>
<static-binding name="invert">true</static-binding>
</component>
<component id="ifNotHasStaff" type="Conditional">
<binding name="condition" expression="staffList.empty"/>
</component>
public class EnquiryPage extends BasePage {
private String fullName;
private boolean isManager;
private List staffList;
public String getFullName() { return fullName; }
public boolean isManager() { return isManager; }
public List getStaffList() { return staffList; }
public void detach() {
fullName = null;
isManager = false;
staffList = null;
super.detach();
}
}
|