Addressing specific nodes in Tree script APIs
There is a difference in the way the web client and the Windows client operate on nodes addressed from Tree scripting APIs.
See About the FormComponent object.
In the web client
In the web client, the Tree component does not implement a "dummy" child node. Therefore, addressing any node that has not yet been loaded using expansion of the parent simply returns without performing any action.
In the Windows client
In the Windows client, the Tree component implements an invisible "dummy" child node that is a place holder for a "real" child node. After a parent node is first expanded, this "dummy" child node is deleted and replaced by the "real" child node(s). When created and loaded, these "real" child node(s) each reference a "dummy" child node and so on as each node is successively expanded. If no "real" child node exists, then this dummy node is simply deleted when the parent is expanded.
When a "dummy" child node is addressed from a script API, the framework addresses the specified operation on the parent of that dummy node. In the following example, node index series "0" addresses level 1 node 1. (For more information about addressing specific nodes, see Notes on the Tree Node ID (GUID) and Index Series.)
ThisForm.Components("tree_comp_name").ExpandNodeAt("0")
For example, if the above script method is executed against a tree that has not yet been expanded, the parent node (root node in this case) is expanded. If node 1 of level 1 has already been loaded (expanded from the root), then the above script method expands that node. Since the "dummy" child node can only exist on parent nodes that exist and have been loaded, a script method addressing any node in the framework at a level and index beyond where a "dummy" child would exist will simply return without performing any action.
In both the web client and the Windows client
Methods executed against nodes that have been "loaded" operate the same in both the web client and the Windows client. When writing form script code that is expected to work the same against Tree components in both a web client and a Windows client, structure the code so that unexpanded child nodes ("dummy" child nodes in Windows client) are never addressed.