Application Development and Automation 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: 
Read only

Global classes / Doppelclick

Former Member
0 Likes
312

Hello Every Body,

please can someone tell me how can implement Doppelclick using Global classes.!!

Best regards.

daniel

1 REPLY 1
Read only

uwe_schieferstein
Active Contributor
0 Likes
294

Hello Daniel

I assume you want to handle DOUBLE_CLICK events of controls (e.g. ALV grid, tree) using global classes.

That's a piece of cake. Below I outline a possible procedure:

(1) Create your control instance (e.g. go_grid, CL_GUI_ALV_GRID)

(2) Create an instance of your global class. The CONSTRUCTOR method may look like this:


CREATE OBJECT go_myclass
  EXPORTING
    io_instance = go_grid.  " Assumption: class should only handle ALV grid events


METHOD constructor.

  me->mo_grid = io_instance.  " class may have instance attribute for grid instance

  me->set_handler( ).  " perhaps private method for setting event handler  
...
ENDMETHOD.


METHOD set_handler.
  SET HANDLER: handle_double_click FOR me->mo_grid.
ENDMETHOD.

(3) Create an event handler method (e.g. HANDLE_DOUBLE_CLICK for event DOUBLE_CLICK of cl_gui_alv_grid) within your global class.

That's it. As soon as the user double-clicks on a row in the ALV grid (go_grid) the method HANDLE_DOUBLE_CLICK of your global class will be called to handle the event.

Regards

Uwe