Release Notes > JTGO 4.0 Release Notes > New Features > Tree Component

The tree component has been improved in the following way:

Load on Demand

The tree component supports load on demand using expansion types defined in CSS configuration files. The expansion type IN_PLACE allows each tree level to be loaded only upon request, either through the API or through the user interface by expanding a tree branch.

It is now possible to define new expansion strategies in the tree component. Expansion strategies are created by an expansion strategy factory registered in the tree adapter. The tree component provides a default expansion strategy factory that creates expansion strategies according to the value of the CSS expansion property (NO_EXPANSION, IN_PLACE or IN_PLACE_MINIMAL_LOADING). If you wish to define a new load-on-demand implementation, you need to:

  1. Create a new expansion strategy implementation (see ilog.cpl.util.IlpExpansionStrategy).
  2. Create a new expansion strategy factory implementation (see ilog.cpl.tree.IlpDefaultTreeExpansionStrategyFactory).
  3. Register this factory in the adapter (see ilog.cpl.datasource.IlpAbstractHierarchyAdapter.setExpansionStrategyFactory).

The expansion strategy implementation should load or release the objects in the tree adapter using the methods loadChildren and releaseChildren.