Skip to Content
author's profile photo Former Member
Former Member

Dynamic recursive tree


I'm currently programming a Web Dynpro application that uses a dynamically

populated tree control. At the beginning the tree has only one child node (root).

When clicking on this node the child nodes for this node are created dynamically.

When clicking on the newly created child nodes, there will be nodes inserted

as child of these nodes (and so on).

While in my application the needed information for creating the new child nodes

is retrieved from SAP R/3 via BAPIs, in the demo application I insert always five

child nodes (labeled "Dyn node 0-4").

Here is a short description of my demo application:


ValueNode (RecTree)

- ValueAttr (text)

- RecNode (RecChild)


IRecTreeElement first = wdContext.createRecTreeElement();



onActionNodeClick(): // EventHandler called when clicked on a node

// get the currently selected node

IRecTreeElement current = null;

for (current = wdContext.currentRecTreeElement();

current.currentRecChildElement() != null;

current = current.currentRecChildElement());

IRecTreeNode curNode = current.nodeRecChild();

for(int i=0; i<5; ++i)


IRecTreeElement dynElem = curNode.createRecTreeElement();

dynElem.setText("Dyn node " + i);



By clicking on a node (to fill in new childs), expanding it, clicking on one

of the newly created childs, expanding it, ... I'm able to create only two

new levels of child nodes. What do I have to do if I need more levels of

dynamically created child nodes?

When population the tree in the wdDoInit()-method there is no such

limitation for the depth of the tree, but I need to do this part dynamically ;-(.

I hope there is a solution for this problem...

Best regards


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2004 at 06:41 PM

    Hi Thomas,

    I guess you have already seen the post within this forum "Use Tree Recursive in web dynpro" where I described the demo application...

    Need to talk to the developers!

    Best regards, Karin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.