The ComboBox class / ui.ComboBox methods |
Search for a combobox in the current form.
ui.ComboBox.forName( name STRING ) RETURNING result ui.ComboBox
After loading a form with OPEN WINDOW WITH FORM, use the class method to retrieve a ui.ComboBox object into a variable defined as a ui.ComboBox.
DEFINE cb ui.ComboBox LET cb = ui.ComboBox.forName("formonly.airport")
Verify the function has returned an object, as the form field may not exist.
IF cb IS NULL THEN ERROR "Form field not found in current form" EXIT PROGRAM END IF
Once instantiated, the ui.ComboBox object can be used, for example to fill the items of the drop down list.
CALL cb.clear() CALL cb.addItem(1,"Paris") CALL cb.addItem(2,"London") CALL cb.addItem(3,"Madrid")