cancel
Showing results for 
Search instead for 
Did you mean: 

Expanding Tree Node

Former Member
0 Kudos

Hi,

I have Tree Node UI Element with 2 Nodes.

Main Node

|

|- Node 1

|- Node 2

When I click on the page and the Tree UI shows up, I would like Node 1 and Node 2 to be expanded.

Is there any way I could achieve the same.

I am able to expand Node 1 or Node 2 when page shows up, but am not able to expand both Node 1 and 2 when page shows up.

Any advice would be appreciated.

Thank you.

NAC

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The nodes under your main node need to be setup as non-singleton (singleton set to false). Unfortunately the default is 'true' for this and it can cause confusion when setting up tree nodes.

If you want them to show up as expanded when it is first displayed, you will need to run your supply function to populate the nodes and then set the expanded property on the nodes to true.

Cindy

Message was edited by: Cindy Herrman

Former Member
0 Kudos

I have tried this but only one node expands not both the nodes.

NAC

Former Member
0 Kudos

Are you using a recursive node in the context for the tree?

If so, in the context you should have an attribute of type boolean (called something like IsExpanded) that should be bound to the expanded property of the TreeNodeType (Node) in the tree layout.

When you populate the tree context, add the children for the node levels you want expanded and be sure to set the IsExpanded attribute to true.

There are a couple of tutorials on using trees (recursive and non-recursive trees).

Recursive tree: http://help.sap.com/saphelp_nw04/helpdata/en/5e/7c5540b8cdcd01e10000000a155106/frameset.htm

I can't seem to find the one for the non-recursive tree (I think it's been moved).

Cindy

Answers (0)