Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Inserting items below the root level – PB Docs 2022 – PowerBuilder Library

Inserting items below the root level – PB Docs 2022

Inserting items below the root level

The first time a user tries to expand an item to see its children,
PowerBuilder triggers the ItemPopulate event if and only if the value of
the item’s Children property is TRUE. In the ItemPopulate event, you can
add child items for the item being expanded.

Parent item’s Children property

If the ItemPopulate event does not occur when you expect, make
sure the Children property for the expanding item is TRUE. It should
be set to TRUE for any item that will have children.

Inserting items not restricted to the
ItemPopulate event

The ItemPopulate event helps you design an efficient program. It
will not populate an item that the user never looks at. However, you do
not have to wait until the user wants to view an item’s children. You
can add children in any script, just as you added items at the root
level.

For example, you might fully populate a small TreeView when its
window opens and use the ExpandAll function to display its items fully
expanded.

Has an item been
populated?

You can check an item’s ExpandedOnce property to find out if the
user has looked at the item’s children. If the user is currently looking
at an item’s children, the Expanded property is also TRUE.

Example

This TreeView lists composers and their music organized into
categories. The script for its ItemPopulate event checks whether the
item being expanded is at level 1 (a composer) or level 2 (a category).
Level 3 items are not expandable.

For a level 1 item, the script adds three standard categories. For
a level 2 item, it adds pieces of music to the category being expanded,
in this pattern:

This is the script for ItemPopulate:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x