A script-enabled browser is required for this page to function properly.

Managing List Items

The individual list elements of a list item (poplist, listbox, checkbox, and so on) are accessed by using a set of methods on the Item class using a 1-based index (that is, there is no zero-element, counting starts at 1) instead of an iterator. The methods of the Item class that work with an index parameter are:

Inserting or deleting elements will re-index all the elements in the list subsequent to the affected element. Be careful when manipulating list item elements; there is no protection here which compares with the iterator model, so it is possible to write code which will give unexpected results or loop infinitely. For example:

  
...
for(int i = 1; i<=item.getListElementCount(); i++)
{
  item.insertListElement(i,"Fred","Barney");
}
...