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: 

Handling event for Tree Control Collapse

Former Member
0 Kudos
113

Hi,

Can any one suggest how to handle an event for 'Tree Node Collapse' . I have checked with all the exised tree events.

thanks,

Venu

4 REPLIES 4

Hans
Explorer
0 Kudos
73

Try event LEFT_CLICK_RUN. Maybe you can keep track of which nodes are expanded and which aren't, and when that event is raised, you can compare your list with the actual state of the tree and decide that a node was collapsed.

Hope this helps,

Hans.

Former Member
0 Kudos
73

Hi Hans,

I have tried this event, this is not triggering .Can you please tell me is there any considerations for this event.

Thanks,

Venu

0 Kudos
73

Assuming you've properly registered the event and created a handler and everything, I'm all out of ideas.

Sorry!

Former Member
0 Kudos
73

Hi Venugopal,

If you are doing tree control programmin then i can suggest you a approach for tree node collapse and expand.

for doing this follow these steps.

1. create a toolbar (use class cl_gui_toolbar), add a button and assign a FCODE to it.

2. here you register the following the event for the toolbar.

gs_event-eventid = cl_gui_toolbar=>m_id_function_selected.

3. here you set the handler for the toolbar events

SET HANDLER gref_application->handle_function_selected

FOR gref_toolbar.

4. now in your class for gref_application you write a definition and implementation.

definition

handle_function_selected FOR EVENT handle_function_selected OF cl_gui_toolbar IMPORTING fcode.

implementation

CASE fcode.

when 'collapse'.

CALL METHOD xref_tree->collapse_all_nodes.

this method might change depending upon the class you use for creating the tree.

i hope this will help you.

in case of clarification do get back to me.

regards,

Kinshuk Saxena

PS mark helpful answers