Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CL_GUI_ALV_TREE - Illegal Event Combination (selection_changed + link_clicked )

Hey,
I have a dynpro with 3 custom containers, each of these contains an ALV control. The one of the left is an instance of cl_gui_alv_tree the other 2 are instances of cl_gui_alv_grid.

On the tree I have registered the event 'selection_changed' to dynamically alter the output of the alv grids whenever the user makes certain changes in the node selection. This functionality is essential for the program.

Now I had the idea of implementing a nice additional (non essential) feature. Whenever the user clicks on certain leaves (which should be designed as links), I want to use the function 'RS_TOOL_ACCESS' to delegate the user to the class the leaf represents. For that I wanted to register the event 'link_click' on the tree.
However combining 'link_click' and 'selection_change' is not possible obviously. This seems to be due to the 'item_selection' parameter that is set in the constructor of 'cl_gui_alv_tree'. For 'node_seletion' to work it has to be set false, for 'link_click' to work, it needs to be true.

Is there a way around this limitation ?

Thank you in advance !

2 REPLIES 2

Sandra_Rossi
Active Contributor

CL_GUI_ALV_TREE doesn't work very well. For instance, the combination of item_selection and context menu fails too. If you don't need the ALV features of CL_GUI_ALV_TREE, you may use directly the GUI control it's based on, which is CL_GUI_COLUMN_TREE.

Thank you for the answer. I decided pro gui_alv_tree and against one of the tree controls, because it seemed like integrating a toolbar is more of a hassle with the latter (maybe I judged wrongly). If I had known about the limitations of gui_alv_tree, maybe I would have decided differently.

My "work around" consists of not using 'selection_changed' anymore, but instead work with buttons and links.