ui.ListBox methods

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

To manipulate ui.ListBox objects, you have to:

Available methods

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

Methods for changing the content of a list box

create()

creates an object of the ui.ListBox class:

LET lbx= ui.ListBox.Create("f1")

forName()

initializes the object of the ui.ListBox class:

LET lbx= ui.ListBox.ForName("f1")

addItem()

adds a new option to the list box:

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

CALL lbx.AddItem(option_value,option_text)

removeItem()

deletes an option from the list box:

CALL lbx.RemoveItem("value")

CALL lbx.RemoveItem(remove_option)

clear()

removes all the options from the list box:

CALL lbx.Clear()

getItemCount()

returns the number of options in the list box:

DISPLAY lbx.GetItemCount()

getItemName()

returns the value of the list box option:

DISPLAY lbx.GetItemName(4)

DISPLAY lbx.GetItemName(input_var)

getItemText()

returns the text of the list box option:

DISPLAY lbx.GetItemText(4)

DISPLAY lbx.GetItemText(input_var)

getTextOf()

returns the text of the list box option:

DISPLAY lbx.GetTextOf("value")

DISPLAY lbx.GetTextOf(value_var)

getIndexOf()

returns the index of the list box option:

DISPLAY lbx.GetIndexOf("value")

DISPLAY lbx.GetIndexOf(value_var)

getTag()

returns the identifier of the list box

Methods for changing the properties of a list box

setEnableMultiSelection()

allows selecting several options at a time:

CALL lbx.setSetEnableMultiSelection(1)

CALL lbx.setSetEnableMultiSelection(TRUE)

getEnableMultiSelection()

returns whether it is allowed to select several options at a time

setListBoxValues()

renames the list box options:

CALL lbx.SetListBoxValues("new_option")

CALL lbx.SetListBoxValues(["new_option1","new_option2","new_option3"])

getListBoxValues()

returns the text of all list box options

setSelectedItems()

selects one or more list box option:

CALL lbx.setSelectedItems(1)

getSelectedItems()

returns the index of the selected items (both selected manually and from the 4gl code)

setHelperText()

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

CALL lbx.SetHelperText("helperText")

getHelperText()

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

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.