Conditional Evaluation

The evaluation of an element could be conditional. By specifying the if or unless attribute or both, developers could control whether to evaluate the associated element.

In the following example, the window component is created only if a is 1 and b is not 2. If an element is ignored, all of its child elements are ignored, too.

<window if="${a==1}" unless="${b==2}">
    ...    
</window>

The following example controls when to interpret a piece of Java codes.

<textbox id="contributor"/>
<zscript if="${param.contributor}">
    contributor.label = Executions.getCurrent().getParameter("contributor");    
</zscript>