Checkbox Component Index DatePicker

Conditional
org.apache.tapestry.components.Conditional
Non Visual Component
 
Description
Makes part of an HTML template conditional. The body of the Conditional component is only rendered if a specified condition is met.
See Also
Foreach, Insert
Parameters
Name Type Direction Required Default Description
condition boolean in yes false The condition to be met. If this value is true, then the wrapped elements will be rendered.
invert boolean in no false If true, then the condition is inverted. This is useful for simulating an else clause.

With Tapestry 2.2 it is easier to specify "!" operator in the condition's ONGL expression.

element String in no   If specified and condition is satisfied, then the component acts like an Any, emitting an open and close tag. Informal parameters are applied to the tag. If no element is specified, informal parameters are ignored.

Body: rendered
Informal parameters: allowed
Reserved parameters: none

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>


<property-specification name="fullName" type="java.lang.String"/>
<property-specification name="manager" type="boolean"/>
<property-specification name="staffList" type="java.util.List"/>
public abstract class EnquiryPage extends BasePage { public abstract String getFullName(); public abstract void setFullName(String value); public abstract boolean isManager(); public abstract void setManager(boolean value); public abstract List getStaffList(); public abstract void setStaffList(List value); }

Checkbox Component Index DatePicker