Loading...
 

SetLevels

SetLevels

SetLevels(windowID, oboxID), SetLevels(, oboxID), SetLevels

parameters: Identifier of a Windows and an object box

Stack
Stack Position Description
Stack(In) Top n
Stack(Out) Top -

If structured data are displayed in an ObjectBox (especially in the ObjectTree), the call of SetLevels limits the hierarchy depth, in which objects are automatically read in and internally represented (loaded from the database).
However, all objects located below this depth can be displayed by interactively unfolding the parent level on the surface and by calling OboxExpand. For the user this delayed behaviour is even transparent, because the icons for expansion, just like for completely read-in structures, only appear if there are also subordinate objects on the respective object.

The most important limitation compared to objects that are read in with a delay is that the system only treats them as existing after they have been read in (GetCollection only brings exactly those objects that have already been displayed once). Thus, before the first opening of the topmost node at 1 SetLevels a select with a subordinate object always fails. If the user briefly opens and closes the topmost node, a Select with a 2nd level object will then be successful. The behaviour in this example can be solved by 2 SetLevels, but a corresponding problem remains one level later.

This delayed reading of objects is switched off by the parameter 0: 0 SetLevels.
Now GetCollection returns all objects that would be displayed in the list if all nodes were expanded.

The default value for SetLevels is 1, as this guarantees the fastest screen display.
The counting of the levels starts with the elements just below the (virtual) main node (root).

Code example:
ObjectTree(CX_APPLICATION_SCHEDULE::this, ENTIRE, NO_DRAIN, AUTO_POSITION, 8, 12, 165, 22) [ INITIALIZE: [ "CX_TRANSACTION::subTransactions" NODE ] SetFormat [ "CX_TRANSACTION::uniqueID" COLOR LIGHTRED ] SetFormat [ "CX_TRANSACTION::personInCharge.idInitials" COLOR CYAN ] SetFormat [ "CX_TRANSACTION::mlShortName" COLOR LIGHTBLUE ] SetFormat [ "CX_TRANSACTION::mlDescription" COLOR CYAN ] SetFormat 0 SetLevels // Disable quick display and load all items into list at once! ]

See also