ui.Combobox.SetDefaultInitializer()

The SetDefaultInitializer() method is used to specify the default function which will be used for combo box initialization each time the program creates a new ComboBox object. This class method needs the quoted name of the function or a variable containing the function name as an argument.

 

CALL ui.ComboBox.SetDefaultInitializer("init_function")

 

The initializing function should use the ComboBox object as the argument. The ComboBox object needs to be declared by a DEFINE statement within this function. Each time an object of ui.Combobox class is initialized in the program, the initialization function is called and the new ui.Combobox object is passed to it as a parameter. Thus it is possible to alter the combo box contents even before the corresponding form was opened.

 

SetDefaultInitializer() method needs the function name specified in lower-case.

 

 

 

Here is an example of the method application:

 

CALL ui.ComboBox.setDefaultInitializer("init_func")

....

  FUNCTION init_func(cbx)

   DEFINE cbx ui.ComboBox

   CALL cbx.clear()

   CALL cbx.addItem(1,"Village")

   CALL cbx.addItem(2,"Town")

   CALL cbx.addItem(3,"City")

 END FUNCTION