!--a11y-->
Recursive Context Nodes 
Web Dynpro provides what are called recursive context nodes to represent recursive data structures in a controller context.
The following example shows a file system consisting of directories and documents in the context.
|
A file system consists of folders and documents. Folders can be additional folders or can contain several documents. If you think of a file system as a tree, then folders represent nodes and documents in it. |
|
If you transfer the file system’s schema to a controller context, then the top level begins with a context node called Folders with cardinality 0..n. This folders node can contain a node collection of as many node elements of type Folder as you like. In addition to a context attribute for the folder name, the Folders node also contains a dependent node called Documents for the documents contained in the folder. This node also has cardinality 0..n and also has the property Non-Singleton=true, that is, each node element of type Folders receives its own instance of the Document node at runtime. Folders can contain additional folders. This recursive relation can be defined in the context by adding what is called a recursive context node in the Folders node. This node only has two properties. On the one hand, its name (here Child) and on the other, property repeatedNode. This property defines the context node to be repeated, the Folders node in the following example. |
|
At runtime, each node element of type Folders can contain separate instances of the Folders and Documents nodes. Recursive context nodes always exist as non-singleton nodes at runtime, that is, each node element of type Folders has its own object instances of the recursive child node. Only in this way can the contents of several nodes on the same level can be displayed in the tree interface element.
|
A recursive context node is not defined by setting a relation in the node to itself. Instead of such a property, a special child node is added, which only has two properties:
1. name: Name of the recursive context node. As is the case with usual context nodes, the names of recursive nodes have to be unique within a controller context.
2. repeatedNode: Address of the context node to be repeated. The address of this node is automatically entered by the Web Dynpro tools in the property field of the context perspective view.
Recursive context nodes are implicitly of type non-singleton.