Entering content frame

Object documentationWeb Dynpro Tree API - IWDTree Locate the document in its SAP Library structure

Definition

Hierarchies defined in the context can be visualized using the Tree UI element. The hierarchy to be displayed is defined in the context. You can describe this context structure in two ways:

·        If the number of levels is not known at design time, a recursive node is used (see Structure linkCode Example of the Use of a Recursive Node).

If the number of levels is already specified at design time, a recursive node is not used (see Structure linkCode Example for Creation of a Tree UI Element).

The following graphic shows how the UI element is displayed:

This graphic is explained in the accompanying text

You can now display a hierarchical tree structure with a list of elements that are known as tree nodes. A tree can contain any number of tree node types (see Web Dynpro IWDAbstractTreeNode API, Web Dynpro IWDTreeItemType API, Web Dynpro IWDTreeNodeType API).

 

The Tree UI element is bound against the top-level context node to be displayed.

You use nodes (TreeNodeType elements) or leaves (TreeItemType-Elemente) to specify which subnodes are to be displayed and which context atttributes are to be displayed on these subnodes as a text or tooltip. The dataSource property of the TreeNodeType element or TreeItemType element is bound to the corresponding context node and the properties text, tooltip, and so on, are bound to the corresponding context attributes on this context node.

TreeItemType elements cannot have children. Therefore, they are always displayed as leaves. They are used when it is decided at design time that the corresponding node does not have children. When using TreeNodeType elements, the decision of whether to use children is dynamically made at runtime.

Note

Hierarchy levels defined in the context cannot be left out when displaying the UI element. For example, a TreeNodeType element that is bound to the Orders must also exist to display the items for the hierarchy Customers ® Orders ® Items, which is defined in a context.

All nodes that are not directly below the context root node must be non-singleton nodes, because all elements should be displayed in a tree regardless of the lead selection.

Description of the UI Element Properties

·        dataSource
This property is used to specify the data source. You can use it to specify the path to the context node providing the data.

·        defaultItemIconAlt
Describes an alternative text for the graphic of a leave that is displayed when the corresponding graphic is not available or cannot be loaded.

·        defaultItemIconSource
Describes the Web address (URL) of the graphic to be displayed for a leave.

·        defaultNodeIconAlt
Describes an alternative text for the graphic of a node that is displayed when the corresponding graphic is not available or cannot be loaded.

·        defaultNodeIconSource
Describes the Web address (URL) of the graphic to be displayed for a node.

·        minHeight
Specifies the minimum height of the tree.

·        rootText
Describes the text for labeling the root node.

·        rootVisible
Specifies whether the root node of the tree structure is visible.

·        title
Describes the tree header.

·        titleVisible
Specifies whether the tree label is visible.

·        width
Specifies the width of the tree and can be specified in CSS units like em, ex, pixels, or percentage.

Overview of Inherited and Additional Properties

Name

Interface

Type

Initial Value

Bindable

Value Required

dataSource

IWDTree

Object

 

bindable_mandatory

No

defaultItemIconAlt

IWDTree

String (TranslatableText)

 

bindable

No

defaultItemIconSource

IWDTree

String

 

bindable

No

defaultNodeIconAlt

IWDTree

String (TranslatableText)

 

bindable

No

defaultNodeIconSource

IWDTree

String

 

bindable

No

enabled

IWDUIElement

boolean

true

bindable

No

minHeight

IWDTree

String (CSS size)

 

bindable

No

rootText

IWDTree

String (TranslatableText)

 

bindable

No

rootVisible

IWDTree

boolean

true

bindable

No

title

IWDTree

String (TranslatableText)

 

bindable

No

titleVisible

IWDTree

WDVisibility

visible

bindable

No

tooltip

IWDUIElement

String (TranslatableText)

 

bindable

No

visible

IWDUIElement

WDVisibililty

visible

bindable

No

width

IWDTree

String (CSS size)

 

bindable

No

Note

The tooltip property is ignored and does not affect the browser.

Data Binding

See Structure linkData Binding of a Tree UI Element.

Methods in the Web Dynpro IWDTree API

Method Name

Parameter

Return Value

Short Description

addNodeType

(IWDAbstractTreeNodeType nodeType)

 

Adds a NodeType element at the end of the NodeType elements list.

addNodeType

(IWDAbstractTreeNodeType nodeType, int index)

 

Adds a NodeType element at the specified index position of the NodeType elements list.

bindDataSource

(String path)

 

Binds the dataSource property to the context node specified by a path.

bindDefaultItemIconAlt

(String path)

 

Binds the defaultItemIconAlt property to the context node specified by a path.

bindDefaultItemIconSource

(String path)

 

Binds the defaultItemIconAlt property to the context node specified by a path.

bindDefaultNodeIconAlt

(String path)

 

Binds the defaultNodeIconAlt property to the context node specified by a path.

bindDefaultNodeIconSource

(String path)

 

Binds the defaultNodeIconSource property to the context node specified by a path.

bindingOfDataSource

 

String

Returns the path of the context element to which the dataSource property is bound. Returns NULL if no binding exists.

bindingOfDefaultItemIconAlt

 

String

Returns the path of the context element to which the defaultItemIconAlt property is bound. Returns NULL if no binding exists.

bindingOfDefaultItemIconSource

 

String

Returns the path of the context element to which the defaultItemIconSource property is bound. Returns NULL if no binding exists.

bindingOfDefaultNodeIconAlt

 

String

Returns the path of the context element to which the defaultNodeIconAlt property is bound. Returns NULL if no binding exists.

bindingOfDefaultNodeIconSource

 

String

Returns the path of the context element to which the defaultNodeIconSource property is bound. Returns NULL if no binding exists.

bindingOfMinHeight

 

String

Returns the path of the context element to which the minHeight property is bound. Returns NULL if no binding exists.

bindingOfRootText

 

String

Returns the path of the context element to which the rootText property is bound. Returns NULL if no binding exists.

bindingOfRootVisible

 

String

Returns the path of the context element to which the rootVisible property is bound. Returns NULL if no binding exists.

bindingOfTitle

 

String

Returns the path of the context element to which the title property is bound. Returns NULL if no binding exists.

bindingOfTitleVisible

 

String

Returns the path of the context element to which the titleVisible property is bound. Returns NULL if no binding exists.

bindingOfWidth

 

String

Returns the path of the context element to which the width property is bound. Returns NULL if no binding exists.

bindMinHeight

(String path)

 

Binds the minHeight property to the context node specified by a path.

bindRootText

(String path)

 

Binds the rootText property to the context node specified by a path.

bindRootVisible

(String path)

 

Binds the rootVisible property to the context node specified by a path.

bindTitle

(String path)

 

Binds the title property to the context node specified by a path.

bindTitleVisible

(String path)

 

Binds the titleVisible property to the context node specified by a path.

bindWidth

(String path)

 

Binds the value of the width property to the context element specified by the path.

destroyAllNodeTypes

 

 

Removes all NodeType elements. These are destroyed and no longer exist, so that the associated IDs can be used for new elements.

getDefaultItemIconAlt

 

String

Returns the value of the defaultItemIconAlt property.

getDefaultItemIconSource

 

String

Returns the value of the defaultItemIconSource property.

getDefaultNodeIconAlt

 

String

Returns the value of the defaultNodeIconAlt property.

getDefaultNodeIconSource

 

String

Returns the value of the defaultNodeIconSource property.

getMinHeight

 

String

Returns the value of the minHeight property.

getNodeTypes

 

IWDAbstractTreeNodeType[]

Returns an array of the NodeType elements.

getRootText

 

String

Returns the value of the rootText property.

getRootVisible

 

boolean

Returns the value of the rootVisible property.

getTitle

 

String

Returns the value of the title property.

getTitleVisible

 

WDVisibility

Returns the value of the titleVisible property.

getWidth

 

String

Returns the value of the width property.

hasNodeTypes

 

boolean

Checks whether or not NodeType elements exist in this Tree element.

iterateNodeTypes

 

Iterator

Returns an iterator about all NodeType elements in this Tree element.

numberOfNodeTypes

 

int

Returns the number of the NodeType elements.

removeAllNodeTypes

 

 

Removes all NodeType elements. They remain and can be added to this Tree element.

removeNodeType

(int index)

IWDAbstractTreeNodeType

Removes the NodeType element at the specified index position.

removeNodeType

(String id)

IWDAbstractTreeNodeType

Removes the NodeType element with the specified ID.

setDefaultItemIconAlt

(String defaultItemIconAlt)

 

Sets the value of the defaultItemIconAlt property.

setDefaultItemIconSource

(String defaultItemIconSource)

 

Sets the value of the defaultItemIconSource property.

setDefaultNodeIconAlt

(String defaultNodeIconAlt)

 

Sets the value of the defaultNodeIconAlt property.

setDefaultNodeIconSource

(String defaultNodeIconSource)

 

Sets the value of the defaultNodeIconSource property.

setMinHeight

(String minHeight)

 

Sets the value of the minHeight property.

setRootText

(String rootText)

 

Sets the value of the rootText property.

setRootVisible

(boolean rootVisible)

 

Sets the value of the rootVisible property.

setTitle

(String title)

 

Sets the value of the title property.

setTitleVisible

(WDVisibility titleVisible)

 

Sets the value of the titleVisible property.

setWidth

(String width)

 

Sets the value of the width property.

Additional methods described in the following APIs are available using inheritance: IWDUIElement, IWDViewElement.

  

  

 

Leaving content frame