Ansicht
Dokumentation

SAPTLIST_TREE_MODEL_DEMO - Example: List Tree Model (with Documentation)

SAPTLIST_TREE_MODEL_DEMO - Example: List Tree Model (with Documentation)

CL_GUI_FRONTEND_SERVICES - Frontend Services   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Description

This program demonstrates the use of the List Tree Model (class CL_LIST_TREE_MODEL).

The contents of a List Tree Model are displayed using a List Tree Control.

The example shows some important attributes of the List Tree Control, which are explained here with reference to the program:

  • "Objects" item: This item is displayed using a proportional font. Using a proportional font for an item only makes sense if the width of the item is automatically fitted to the text string (so that the text always fits within the space provided). To ensure this, the ALIGNMENT field for the item must contain the value CL_LIST_TREE_MODEL=>ALIGNMENT_AUTO.
  • The items in the third and fourth nodes form a table. To do tihs, the first three items in both nodes must have the same length (ITEM-ALIGNMENT = CL_LIST_TREE_MODEL=>ALIGN_LEFT, ITEM-LENGTH = ...) You must then use a fixed font for these items (ITEM-FONT = CL_LIST_TREE_MODEL=>ITEM_FONT_FIXED).

Selection

The items of a node can be selected individually. By clicking on the folder or leaf symbol of a node, you select the entire node.
You can also set up the tree so that clicking on any part of a node always selects the entire node (by setting the ITEM_SELECTION parameter of the constructor to ' ').

Events

Events, as they occur, are displayed in the group box at the right-hand side of the screen. You can trigger the following events in the program:

NODE_DOUBLE_CLICK

Double-click on a node. In the example, you must double-click the folder or leaf symbol to do this. If you set ITEM_SELECTION to SPACE, the event is triggered when you double-click any part of the node.

ITEM_DOUBLE_CLICK

Double-click on an item in the tree. This event can only occur if ITEM_SELECTION = 'X'.






CL_GUI_FRONTEND_SERVICES - Frontend Services   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 1990 Date: 20240520 Time: 131547     sap01-206 ( 42 ms )