The Workbench must be in change mode if you want to create and maintain context nodes.
· To create a context node, open the context menu for the CONTEXT root node and choose Create ® Nodes.
The following options are available when you create a context node:
Node Name |
Name of the node to be created (unique within the context, all uppercase letters). |
Required |
Interface node |
In the context of the component controller, for each node that should be created directly below the root node, you can choose whether it should be placed within the component only (default) or whether the node should also be included at the same time in the component interface, that is, the interface controller. For notes further down in the hierarchy, this option is no longer available as all subnodes automatically assume the value of the parent node. |
Optional |
Input element |
At this point you can decide whether the new node should be available for an external mapping. |
Optional |
Dictionary structure |
If your node should contain attributes from an existing Dictionary structure (such as a table), you can specify this structure here (F4 help). If you link a node in this way to a structure from the Dictionary, you cannot add attributes from outside the structure to these nodes. |
Optional |
Cardinality |
Required node cardinality, which may differ from the default. |
Optional |
Selection |
If you specify the selection cardinality, this determines how many instances of the node may be selected on the screen later for further processing. The selection cardinality 0..1 means that a maximum of one table row can be selected if the node elements are displayed as a table. Its content can be processed in the next step. A selection cardinality 0..n means that any number of table rows can be selected. The selection cardinality must not be selected inconsistently to the node cardinality. For example, if a node has the cardinality 0..n, it is possible that it does not contain any instances at all. This means that the selection cardinality must not start with 1. |
Optional |
Initialization lead selection |
At runtime, exactly one of the element instances of a node has a special position. This is known as the lead selection.
The "lead selection initialization" property determines whether the lead selection should be set automatically as soon as it is required, but is not yet set. The first element of a node is always selected for the lead selection for this automatic initialization. If this flag is not set, the lead selection has to be programmed manually. This is done either in the supply function of the relevant node or in its WDDOINIT method. The following two methods are available for this in the IF_WD_CONTEXT_NODE interface:
. You can use their ELEMENT or INDEX parameters to select a node other than the first element of a node for the lead selection.
Default: „Yes“ (lead selection automatic, and set to the first element of a node) |
Optional |
Singleton |
The singleton property describes the relationship between a subnode and its parent node. The default ("Yes") means that there is only one single instance of the node at runtime – that is, the instance that belongs to the lead selection element of the parent node. However, it is also possible to allow several instances at the same time. In this case, choose "No". |
Optional |
More information about cardinality, singletons, and lead selection, as well as a visual example, is available under Context Nodes: Properties in the Web Dynpro Architecture Manual.
Supply function |
You can specify the name of a supply function for this node. The corresponding method is created automatically and you can program it appropriately at a later point. You also have the option of creating the supply function beforehand (Methods tab page) and adding this using the F4 help when you create the node. |
Optional |
If you selected a Dictionary structure for your node, you can end the creation process by selecting the required attributes from this structure.
· To do this, choose the confirmation button marked "Insert Attribute from Structure".
· The table display of the structure you selected is displayed, where you can select the required attributes.
· When you confirm this window, the node is created and assigned the selected attributes.
In this case, the creation processes for nodes and attributes are summarized in one step.
If you did not select a Dictionary structure for your node, end the creation process by clicking on the confirmation button without the addition. The node is created below the root node and you can now add an attribute in a separate step.
· To create a context node using the wizard, open the context menu for the CONTEXT root node and choose Create using wizard ® Copy nodes from different context.
· To copy a context node using the wizard, enter the name of the Web Dynpro component from whose context you want to copy the node in the following dialog window. You can use the F4 help as usual.
· Once you have selected a component, select the controller from it whose context node you want to copy. This node can originate from a controller context or from the context of a view. Root nodes cannot be copied, however.
· You now have the option of influencing the structure of the object(s) to be copied. For example, you can decide whether or not you want to copy all attributes in addition to all child nodes of the node to be copied.
· When you close this dialog, you will see a new window that displays the selected node hierarchies, where you can select the node to be copied.
· Double-click on the selected node to display a copy of the context that you are currently processing.
You can create what is called a recursion node in each node below the root node. Recursion nodes enable nodes to be nested iteratively. The node that is used for recursion is always a predecessor of the new node. This does not have to be the direct predecessor node in the hierarchy, however, the node to be repeated can also be located several hierarchy levels higher than the recursion node that will be created.
The newly created recursion node is always a reference to the predecessor node and therefore cannot be processed separately. Instead it takes on the properties and functions of the node to be repeated.
· To create recursion node, select the node to be repeated and open its context menu.
· Choose Create ® Recursion node.
· In the following dialog window, first specify a name for the recursion node and in a second step, select the node to be repeated from the selection list.
· Then confirm the dialog.
The recursion node you have just created is displayed using a special icon and is added to the node hierarchy.
The context menu of a context node contains the Define Mapping entry.
The definition of a mapping between two context nodes is described in a separate document: Defining Mapping.
Once you have created a node for a context, its properties are listed in a table at the bottom of the Editor. You have the option of changing these node properties, as long as the Workbench is in change mode.
If you specified a Dictionary structure during the creation process of a context node, you can include additional components of this structure in your context node from the properties table. To do this, in the Dictionary Structure row, click on the pushbutton on the right hand side. This displays the table of the structure components. As mentioned previously, it is not possible to include in a node any attributes whose type does not correspond to a component of the selected structure.