Show TOC Start of Content Area

Object documentation TreeNodeType This graphic is explained in the accompanying text  Locate the document in its SAP Library structure

Definition

The TreeNodeType object describes a tree node type that, unlike the TreeItemType, can contain additional tree nodes. They represent the nodes of the Tree.

Description of Properties

      expanded

Specifies whether or not a tree node can be collapsed or expanded. The binding of this property is not mandatory, however, we recommend the binding of the property to a context attribute. In this case, this context attribute must be contained in a context node to which the dataSource property is bound. You can now specify the initial expansion status of the tree node.

      hasChildren

Specifies whether or not a tree node has children. If you define an onLoadChildren event handler, the corresponding tree element is displayed as a tree node by default – that is, the tree element has an expansion symbol that can be used to expand or collapse the tree. If you know beforehand or during the LoadOnDemand that a tree element does not contain children, you can set the hasChildren property to false. The default value of this property is true. The tree element is then displayed as a leave without expansion symbol.

Note

The hasChildren property is only evaluated if no data for children of the corresponding tree element is available. Tree elements are always displayed as tree nodes if data for their children is available.

Overview of Inherited and Additional Properties

Name

Interface

Type

Initial Value

Bindable

dataSource

IWDAbstractTreeNodeType

Object

 

bindable_mandatory

design

IWDAbstractTreeNodeType

WDTreeNodeDesign

standard

bindable

expanded

IWDTreeNodeType

boolean

false

bindable

hasChildren

IWDTreeNodeType

boolean

true

bindable

iconAlt

IWDAbstractTreeNodeType

String (TranslatableText)

 

bindable

iconSource

IWDAbstractTreeNodeType

String

 

bindable

ignoreAction

IWDAbstractTreeNodeType

boolean

false

bindable

text

IWDAbstractTreeNodeType

String (TranslatableText)

 

bindable

tooltip

IWDAbstractTreeNodeType

String (TranslatableText)

 

bindable

Events

 

      onAction (String path)

This event is triggered, if the user selects a node.

      onLoadChildren (String path)

This event is triggered, if the data for a compressed tree node that initially has no children is read from the back end only if required. The corresponding event handler is called when a tree node without data for its children is expanded. The Web Dynpro application can use the event handler to read data for the children of the expanded tree node and add this data to the tree.

Note

The event handler of the event onLoadChildren is only triggered during the expansion if no data for the children of the expanded node exists. If the application adds data during the expansion, the event is not triggered when the tree node is opened again.

Since the introduction of the generic event parameter nodeElement the parameter path is not needed anymore and is only available for compatibility reasons.

      onDrop (String data, String mimeType, int offset, String path, String tags)

This event is triggered when the user drops an object onto this TreeNodeType. The parameters are:

       data: The data specified for the drag source.

       mimeType: the mime type specified for the drag source.

       offset: the position relative to the index, the user has dropped the object onto.

       -1: just above the item specified by the index

       0: right onto the item specified by the index

       +1: just below the item specified by the index.

       path: The tree node is described by a path to the node element representing it. Declare an action and event handler parameter of type IWDNodeElement (or one of your own node element classes) along with a suitable parameter mapping; then the path will be automatically transformed into a node element instance.

       tags: the tags defined for the drag source

More Information

Mapping the Generic Event Parameter nodeElement

End of Content Area