This weblog should provide the necessary steps to build a simple recursive tree structure in a Web Dynpro application. First, you should have created a Web Dynpro Application with a component and a view and then there are four process steps.
The result you should obtain is:
1. Create a tree structure in the context view of the application. That means right click on the context, select New and select Value node (TreeNode). Then right click on TreeNode, select New and Recursive node (Child) and finally do the same for value Attribute (visible child text in the tree).
As a result you should have the following structure in the context view:
2. Create a Tree element in the layout view. Right click on the RootUIElementContainer and select Insert Child, then select the tree element in the list.
3. Add a TreeNodeType element to this tree. Right click on the tree element you have just created and select Insert NodeType. Then choose TreeNodeType.
For this two elements, in the properties tab of each select the dataSource field and select the tree element you have created as the data source.
As a result of step 2&3:
Table resume of created Context Elements:
In View.Tree in the table, View is the name of the created view in your Web Dynpro application.
4. Add some code in the wdDoInit() method of your view to populate the tree. For example we create a simple tree on 3 levels.
The createChild method is to be added in the other part of the code:
At that step you have created a simple tree structure on which you can navigate but there are no actions when you click on a leaf.
For more informations on how to add actions and create the tree, click on the following link: