cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro ABAP tree node collapse trigger event of row selection

Former Member
0 Kudos


Hello expert,

I have a table in my WD abap view, I use MasterColumn to display the tree structure, everything works just fine.

However I encounter one problem:

If I open the tree structure and select one node (table row selection), the event onLeadSelectis triggered, this is correct. However if I collapse any  parent nodes (along the tree path) of the selected node, WD puts the selection on the clicked parent and thus the event onLeadSelect is triggered for the parent. This is a strange behavior, because when I collapse a node, I certainly don't want to trigger the onLeadSelect event for the node, becaseu this would invoke the function linked to the event which is only supposed to be triggered when you explicitly select the table row.  (BTW, if you don't select any child nodes, then collapse the parent, it does NOT trigger the event).

I've looked into the wdevent data to see if I can differentiate between the event of node collapsing and row selecting, event data is exact same for both cases, thus I have no way to stop the event handler in case of node collapsing.

Anyone had this issue and a solution for this?

Thanks

Jayson

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Really no one faced this problem? I thought this is not a rare requirement to avoid triggering onSelect event when collapsing tree node.

ramakrishnappa
Active Contributor
0 Kudos

Hi Jayson,

Its the behavior of the tree element, the lead selection of child is carried over to the parent.

Whenever there is lead selection set and on toggling of tree node, first OnToggle event triggers and then OnLeadSelect triggers. So you can control the execution of onLeadSelect by using EXPANDED parameter of event OnToggle.

Please refer the below steps:

  • Create an action ON_TOGGLE for the vent OnToggle of tree element and it will be having parameter EXPANDED
  • Create an attribute in view-->attributes tab GV_EXPANDED
  • Collect the parameter EXPANDED into gv_expanded

          wd_this->gv_expanded = expanded.

  • Now, you can use wd_this->gv_expanded to control the execution of LEADSELECT logic

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

I've also found this solution after digging around

Answers (0)