cancel
Showing results for 
Search instead for 
Did you mean: 

Selected node of tree in web dympro

Former Member
0 Kudos

hi,

is it possible to refresh a selected node of tree in web dympro abap?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Celi,

what do you want to do? update the values in the selected node (change the text, image etc.) or change the selected node?

You can do either - but you will need some kind of event to trigger the update.

Do let us know.

Chris

Answers (1)

Answers (1)

Former Member
0 Kudos

hi Chris,

thak you for replace, i need to change the selected node.

how can i do it ?

thank you Laura.

ChrisPaine
Active Contributor
0 Kudos

Hello Laura,

the Tree UI element shows a node as selected if it is marked as lead selection in the bound context,

But only if its parent is also lead selected. Take the following example of a tree.

branch1

---branch1.1

-


branch1.1.1

-


branch1.1.2

---branch1.2

-


branch1.2..1

branch2

---branch2.1

-


branch2.1.1

-


branch2.1.2

in order to mark branch1.1.1 as selected we need to set the lead selection of the context to branch1, and the subnode of the element - branch1, the context lead selection needs to be set to branch1.1, and finally in the subnode of that element the lead selection of the context needs to be set to 1.1.1

If you know the element that you want to mark as selected, the easiest way is to write a recursive routine that then lead selects all the elements up the tree.

Beware that if you do not deselect the any previous lower level lead selection then the sub node of the one you intended to mark for selection may instead be show as selected! Eg in this example if you subsiquently wanted to show branch1.1 as selected you would need to deselect branch1.1.1

I hope this helps you,

Cheers,

Chris