cancel
Showing results for 
Search instead for 
Did you mean: 

Weird Tree behavior

Former Member
0 Kudos

Hello fellow developers,

my tree controls are displaying quite a strange behavior:

No matter on which node I click, the first one always gets expanded too! (And that's true for every level of the tree and the according first-level node)

I am filling my nodes dynamically via a context-supply-Function.

Does anyone has an idea on how to stop this annoying behavior?

Thanks a lot,

Maxi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Reason might be that the Tree automatically expands the node that has the lead selection. If you recreate the complete tree on every node selection and have set initializeLeadSelection=true, the path along the first node elements will be selected.

To avoid this, you could either set initializeLeadSelection=false or unset the lead selection after filling the tree.

Armin

Former Member
0 Kudos

Ha! Works like a charm! Armin, you're my personal hero! Thanks you!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

<b>expanded </b>is a property of the TreeNodeType. It might be possible that onSelect or onLoad your setting expanded property to true in the wrong node.

Check , if you are accessing the proper child node when you are setting this.

Regards

Bharathwaj

Former Member
0 Kudos

Bharathwaj:

thanks for the answer.

In my 3-level tree "expanded" is on the upper two levels set to "false" (third level can't be expanded obviously ) , and I'm not touching it anywhere in the implementation..

former_member365727
Active Contributor
0 Kudos

Hi,

Set the tree property <i>isExpanded</i> to true, once you have expanded the corresponding node.

Regards

Srikanth

Former Member
0 Kudos

Hi Srikanth,

thanks for you answer!

My tree isn't that dynamical I'm not expanding the nodes myself but leave that to Web Dynpro...

If the answer is still 'isExpanded', would you be so kind as to give me a hint on where excatly to apply that? The 'onAction' function of the concerning tree-element? 'onLoadChildren'? Somewhere entirely different?

Thanks a lot,

Maxi