The ComboBox class / ui.ComboBox methods |
Define the default initializer for combobox form items.
ui.ComboBox.setDefaultInitializer( funcname STRING )
The ui.ComboBox.setDefaultInitializer() class method defines the default initialization function to be called each time a COMBOBOX form field is created when loading forms. Use this method if you want to define a global/default initialization function for all comboboxes of the program. For individual comboboxes, consider using the INITIALIZER form field attribute instead.
The function is called with the ui.ComboBox object as the parameter.
The combobox initialization functions are typically used to fill the drop down list with items.
MAIN ... CALL ui.ComboBox.setDefaultInitializer("cb_init") ... OPEN FORM f1 FROM "customers" DISPLAY FORM f1 -- initialization function is called ... END MAIN FUNCTION cb_init(cb) DEFINE cb ui.ComboBox CALL cb.clear() CALL cb.addItem(0,"Undefined") ... END FUNCTION