cancel
Showing results for 
Search instead for 
Did you mean: 

Auto selection of sub nodes in a table tree column

IanStubbings
Active Participant
0 Kudos

Hi

Quick one. Is there an way to enable the the selection of sub nodes when I select a row( node) in a table tree column? Basically if I select the parent of a leaf, I wish to select all the leaves automatically. Obviously when I de-select the node the reverse should happen.

I assume not hence I have started to code it myself but thought I would check anyway.

Cheers

Ian

Accepted Solutions (0)

Answers (2)

Answers (2)

Yashpal
Active Contributor
0 Kudos

Hi Ian ,

while creating the action handler for the action check transfer UI Event Parameters ( in Popup ) , this will provide u the parameters for the event , and in the table UI element for action onselect , OLD_LEAD_SELECTION parameter is present .

Hope this will help u .

Regards

Yash

IanStubbings
Active Participant
0 Kudos

Hi Yash

I already have the OLD_LEAD_SELECTION and NEW_LEAD_SELECTION parameters present and I using the NEW_LEAD_SELECTION parameter to extract information.

However, I was expecting the is_selected attribute of the NEW_LEAD_SELECTION parameter to be set to abap_false once I deselect the row. I wish to track when the row is deselected as well as selected since I need to deselect all child nodes as well as select them.

Cheers

Ian

Former Member
0 Kudos

Hi,

the easiest would be to loop over the subnode

and use the method set_selected with the sy-tabix as index

grtz,

Koen

IanStubbings
Active Participant
0 Kudos

Cheers Koen.

This is what have so far and works fine. At least I am not coding for no reason!

How do I detect a deselection rather than a selection though? The new_lead_selection parameter still has the is_selected attribute set to X even though - in my mind - this should now be blank.

Ian

Former Member
0 Kudos

Hi,

unfortunately the onLoadChildren event is only triggered when opening the node.

here you can implement the onAction event in combination with the expanded attribute wich you bind in your context.

grtz,

Koen

IanStubbings
Active Participant
0 Kudos

Hi Koen

Forgive me. I'm not sure I understand what you are getting at.

Ian

Former Member
0 Kudos

Hi,

nevermind my solution, the explanation of Yashpal is easier than working

with context attributes to detect the state of the context nodes.

Just add the old_lead_selection to the importing parameters of the action

handler as he suggested.

grtz,

Koen

IanStubbings
Active Participant
0 Kudos

Hi Koen

As per my previous post, I already have the imported parameters present but unfortunately not the values I was looking for!

Thanks for your help

Ian