ui.ComboBox methods

ui.ComboBox methods are used to manipulate ui.ComboBox objects at runtime.

To manipulate ui.ComboBox objects, you have to:

Available methods

There are two groups of methods available for combo boxes - methods that allow changing the content of a combo box and methods that allow changing its properties.

Methods for changing the content of a combo box

create()

creates an object of ui.ComboBox class:

LET cmb = ui.ComboBox.Create("f1")

forName()

initializes the object of ui.ComboBox class:

LET cmb = ui.ComboBox.ForName("f1")

addItem()

adds a new option to the combo box:

CALL cmb.AddItem("added","new")

CALL cmb.AddItem(option_value,option_text)

removeItem()

deletes an option from the combo box:

CALL cmb.RemoveItem("value")

CALL cmb.RemoveItem(remove_option)

clear()

removes all the options from the combo box:

CALL cmb.Clear()

getItemCount()

returns the number of options in the combo box:

DISPLAY cmb.GetItemCount()

getItemName()

returns the value of the combo box option:

DISPLAY cmb.GetItemName(4)

DISPLAY cmb.GetItemName(input_var)

getItemText()

returns the text of the combo box option:

DISPLAY cmb.GetItemText(4)

DISPLAY cmb.GetItemText(input_var)

getTextOf()

returns the text of the combo box option:

DISPLAY cmb.GetTextOf("value")

DISPLAY cmb.GetTextOf(value_var)

getIndexOf()

returns the index of the combo box option:

DISPLAY cmb.GetIndexOf("value")

DISPLAY cmb.GetIndexOf(value_var)

getTag()

returns the identifier of the combo box

setDefaultInitializer()

specifies the default function that will initialize every ui.ComboBox object newly created by the 4gl application:

CALL ui.ComboBox.setDefaultInitializer("init_func")

Methods for changing the properties of a combo box

setAutonext()

specifies whether input must move to the next field after the value specified for maxLength is reached:

CALL cmb.setAutonext(1)

CALL cmb.setAutonext(TRUE)

getAutonext()

returns the value of the autonext property or the setAutonext() method

setEditable()

specifies whether you can select an option by typing its text directly to the text field of a combo box:

CALL cmb.setEditable(0)

CALL cmb.setEditable(FALSE)

getEditable()

returns whether you can select an option by typing its text directly to the text field of a combo box

setMaxLength()

specifies the maximum length in bytes for string input to an editable combo box:

CALL cmb.setMaxLength(10)

getMaxLength()

returns the maximum length in bytes for string input to an editable combo box

setRequired()

forces the user to enter data in the combo box during the INPUT statement (= it cannot be left empty):

CALL cmb.setRequired(1)

CALL cmb.setRequired(TRUE)

getRequired()

returns whether the user is forced to enter data in the combo box during the INPUT statement

setToCase()

specifies the case of a text input to the combo box:

CALL cmb.setToCase("up")

getToCase()

returns the case of a text input to the combo box

setHelperText()

sets the helper text for the combo box (material design):

CALL cmb.SetHelperText("helperText")

getHelperText()

returns the helper text for the combo box (material design):

setLabelText()

sets the label text for the combo box (material design):

CALL cmb.SetLabelText("labelText")

getLabelText()

returns the label text for the combo box (material design)

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.