Skip to Content
author's profile photo
Former Member

Dynamic recursive tree

Hi!

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:

Context:

ValueNode (RecTree)

- ValueAttr (text)

- RecNode (RecChild)

wdDoInit():

IRecTreeElement first = wdContext.createRecTreeElement();

first.setText("Root");

wdContext.nodeRecTree().addElement(first);

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);

curNode.addElement(dynElem);

}

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

Thomas

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    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 comment
    10|10000 characters needed characters exceeded