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 no 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.

Body: rendered
Informal parameters: forbidden
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>


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();
    }
}

Checkbox Component Index DatePicker