Iterative Evaluation

The evaluation of an element could be iterative. By specifying a collection of objects to the forEach Attribute, developers could control how many time of the associated element shall be evaluated. For sake of description, we call an element is an iterative element if it is assigned with the forEach attribute.

In the following example, the list item is created three times. Notice that you have to use EL expression to specify the collection.

<listbox>
<zscript>
grades = new String[] {"Best", "Better", "Good"};
</zscript>
<listitem label="${each}" forEach="${grades}"/>
</listbox>

The iteration depends on the type of the specified value of the forEach attribute.

<listbox>
<listitem label="${each}" forEach="grades"/>
</listbox>