Package com.ebasetech.xi.api
Interface ListItemIterator
- All Superinterfaces:
java.io.Serializable
public interface ListItemIterator
extends java.io.Serializable
The
ListItemIterator
interface provides the ability to iterate through a list's values.
This can be used to set properties on any of the controls used to render the list.
Example:
var items = controls.listControl.list.items; while (items.next()) { var val = items.listValue; if (val == "danger") { controls.listItem1.backgroundColor = "red"; } }
- Since:
- V5.3
-
Method Summary
Modifier and Type Method Description java.lang.String
getListValue()
Returns the value of the current list item.int
getSize()
Returns the number of items in the list.boolean
next()
Iterates through the list's items and sets the next list item as the current item, returns false if no more items exist.
-
Method Details
-
next
boolean next()Iterates through the list's items and sets the next list item as the current item, returns false if no more items exist.All list items referenced by an iterator can be processed within a loop within
while (iter.next())
as shown in the example below.Javascript example:
var items = controls.listControl.list.items; while (items.next()) { var val = items.listValue; if (val == "danger") { controls.listItem1.backgroundColor = "red"; } }
- Returns:
- false when all list items have been processed, true otherwise
- Since:
- V5.3
-
getSize
int getSize()Returns the number of items in the list.- Since:
- V5.3
-
getListValue
java.lang.String getListValue()Returns the value of the current list item.- Since:
- V5.3
-