Special Considerations for the SAP Tree

Use

In addition to the considerations that apply to all controls, you should note the following:

Wherever possible when you use the SAP Tree, you should avoid loading child nodes until the user expands the parent node. If a hierarchy level has a large number of nodes, you should insert artificial intermediate levels. This also gives the user a better overview of your tree structure.

Filling a tree control with a deep hierarchy structure can be a runtime-intensive operation. This problem is not restricted to use in a WAN - it can also occur in a LAN environment. As well as the large amount of data that has to be transferred for a large hierarchy, considerable runtime is also expended inserting the data into the control. Running under a 200 MHz processor, the control can insert around 700 nodes per second into a simple tree (no additional columns).

Since the SAP tree uses keys instead of line and column numbers, and there is no general data model, it is impossible to provide a general solution. When you use the SAP Tree, you must ensure that your programming method results in acceptable performance.

There are three ways of avoiding the problem:

Loading Child Nodes on Demand

See Incremental Tree Construction.

Adding Artificial Intermediate Levels to the Hierarchy

If a node has a large number of child nodes, transferring even only the child nodes of that one node can cause performance problems. Furthermore, if the list of child nodes for a single node extends over several pages, the tree becomes less easily readable for the user.

If you have a node with several child nodes, you can divide them up by using artificial intermediate hierarchy levels. From a technical point of view, a sensible number of same-level nodes is around 500 in a LAN, and around 100 in a WAN.

Explorer-Type Structure

Instead of displaying the leaves of the tree in the tree itself, you could display them in a table control to the right of the tree. In this case, only the folders are displayed in the tree. The leaves, which form a large part of the data, no longer have to be transferred.