Rich UI List

A Rich UI list widget defines a list from which the user can select a single entry.

Here is example code, which displays the list value in a text field:
import com.ibm.egl.rui.widgets.List;
import com.ibm.egl.rui.widgets.TextField;
import egl.ui.rui.Event;

Handler MyHandler Type RUIHandler 
   { initialUI = [myList, myTextField]}

   myList List
   {
      values = ["one", "two", "three", "four"],
      selection = 2, onChange ::= changeFunction
   };

   myTextField TextField
      {text = myList.values[myList.selection]};

   Function changeFunction(e Event in)
      myTextField.text = myList.values[myList.selection];
   end
end 
The following properties are supported:
  • values, which holds an array of strings that each represent a selectable option.
  • selection, which holds an integer that represents the position of the string in the array. If you set the value of selection before displaying the list box, the specified string is displayed in boldface.

    The first string in the array is at position 1, not 0.

  • size, which holds an integer that indicates how many strings to display from the values array. The default is to display all the strings, with no scroll bar:
    • If the value of size is smaller than the number of strings, only the specified number of strings is displayed. A scroll bar provides access to the other strings.

      Initially, only the last strings are displayed.

    • If the value of size is greater than the number of strings, additional spaces are added to the bottom of the list box. The user cannot select content from one of those spaces, which are only for display.

    If you do not set the size property, Internet Explorer 6 displays the widget as a combo box (a combination text box and list box).

Other supported properties and functions are described in “Widget properties and functions.”

Use of this widget requires the following statement:
import com.ibm.egl.rui.widgets.List;