KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: New way to reference Hierarchical Lists!
PRODUCT: 4D Developer | VERSION: 11 | PLATFORM: Mac & Win
Published On: September 26, 2007
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

In 4D v11 SQL Hierarchical Lists can be used in a new way. Instead of referencing them with the reference ID associated to each Hierarchical List in memory they can be referenced by name as objects on a form. This allows developers to display multiple Hierarchical List objects on forms from one Hierarchical List in memory.

In this case there is only one instance of the list in memory, and any changes made to that list affect all form objects referencing it. Each representation can be displayed in a different manner though. The only List properties specific to each form object are:

-The selection
-Whish list items are expanded or collapsed
-The position of the scrolling cursor

The following commands can be called using the object name instead of the reference ID:

SET LIST ITEM
GET LIST ITEM
DELETE FROM LIST
(renamed from DELETE LIST ITEM)
SELECT LIST ITEMS BY POSITION
Count list items
Selected list items
INSERT IN LIST
(renamed from INSERT LIST ITEM)
List item parent
List item position
SET LIST ITEM PROPERTIES
GET LIST ITEM PROPERTIES
SET LIST ITEM FONT
(new command in 4D v11 SQL)
Get list item font (new command in 4D v11 SQL)
Find in list (new command in 4D v11 SQL)
SET LIST ITEM ICON (new command in 4D v11 SQL)
GET LIST ITEM ICON (new command in 4D v11 SQL)
SET LIST ITEM PARAMETER (new command in 4D v11 SQL)
GET LIST ITEM PARAMETER (new command in 4D v11 SQL)



For example:

COMMAND (refID;parameters)

Where COMMAND is one of the list commands and parameters are the appropriate parameters to the command.



In order to reference an object instead of Hierarchical List by reference ID, this changes to:

COMMAND (*;"objectname";parameters)