ui.ListBox.Create() creates a list box.
Syntax
LET ui.ListBox.create("lbx_id", "container_id")
Arguments
lbx_id |
identifier for the list box you create (STRING) |
container_id |
identifier of the container where the list box must be inserted (STRING) |
Usage and examples
Takes two arguments - lbx_id and container_id:
LET lbx = ui.ListBox.Create("lbx1", "f1")
You must directly specify where to put a list box created by this method in your 4gl code.
For example, this is how you insert a list box to a form with a GridPanel:
DEFINE lbx ui.ListBox
DEFINE rLocation ui.GridItemLocation
...
LET rLocation.GridHeight = 1
LET rLocation.GridWidth = 1
LET rLocation.GridX = 0
LET rLocation.GridY = 0
CALL lbx.SetGridItemLocation(rLocation)
If you do not specify the list box identifier (= lbx_id, you will still be able to manipulate it via ui methods, but will not be able to make any manipulations that require this id:
LET lbx = ui.ListBox.Create("", "rootContainer")
For example, you will not be able to change its appearance via .qxtheme or .css.
If you specify a wrong container - the one absent from the form, you will get a runtime error - 1044. No name equivalent.
If you do not specify any container, you will get a runtime error - 2007. Invalid reference:
LET lbx = ui.ListBox.Create("lbx1", "")