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

SIZE_CONTROL Event for docking container

Former Member
0 Likes
2,656

Hi, Everybody

I'm trying to handle size_control event for a docking container. But the event is not trigged. See the code excerpt below:


* Create left docking container
  CREATE OBJECT ao_docking_container_left
    EXPORTING
      side = cl_gui_docking_container=>dock_at_left
      extension = 300
      dynnr = cl_co=>ac_main_screen
      repid = cl_co=>ac_main_prog.

-



* Register the event
 ls_event-eventid = 12.
  ls_event-appl_event = 'X'.
  APPEND ls_event TO lt_events.

  CALL METHOD ao_docking_container_left->set_registered_events
    EXPORTING
      events                    = lt_events
    EXCEPTIONS
      cntl_error                = 1
      cntl_system_error         = 2
      illegal_event_combination = 3
      OTHERS                    = 4
          .
* Set handler
SET HANDLER handle_doclist_resize FOR ao_docking_container_left.

-


I have set the handle_doclist_resize method as a handler for the SIZE_CONTROL event of the CL_GUI_DOCKING_CONTAINER class (by Class Builder).

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,510

Hi Mikola,

Docking Container Resize is a Controls Framework event and is handled inside CL_GUI_CFW class (HORIZONTAL_RESIZE method).

I do not think we will be able register for this event and hanlde it as Framewrk events are system events handled by CL_GUI_CFW.

Sri

Hi, Everybody

I'm trying to handle size_control event for a docking container. But the event is not trigged. See the code excerpt below:


* Create left docking container
  CREATE OBJECT ao_docking_container_left
    EXPORTING
      side = cl_gui_docking_container=>dock_at_left
      extension = 300
      dynnr = cl_co=>ac_main_screen
      repid = cl_co=>ac_main_prog.

-



* Register the event
 ls_event-eventid = 12.
  ls_event-appl_event = 'X'.
  APPEND ls_event TO lt_events.

  CALL METHOD ao_docking_container_left->set_registered_events
    EXPORTING
      events                    = lt_events
    EXCEPTIONS
      cntl_error                = 1
      cntl_system_error         = 2
      illegal_event_combination = 3
      OTHERS                    = 4
          .
* Set handler
SET HANDLER handle_doclist_resize FOR ao_docking_container_left.

-


I have set the handle_doclist_resize method as a handler for the SIZE_CONTROL event of the CL_GUI_DOCKING_CONTAINER class (by Class Builder).

8 REPLIES 8
Read only

Former Member
0 Likes
1,510

Hi,

Where is the class definition and implementation for handling that event?

Read only

0 Likes
1,510

All of it is the same global class.The code above is in the class constructor. Handle_doclist_resize is a handler method of the class.

Read only

0 Likes
1,510

I have transfered my code just into the one programm. But it still doesn't work I guess the SIZE_CONTROL event is not implemented in CL_GUI_DOCKING_CONTAINER.


*&---------------------------------------------------------------------*
*& Report  ZMMM_DOCK                                                   *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*
report  zmmm_dock                               .
data:   ao_docking_container_left type ref to cl_gui_docking_container,
        lt_events type cntl_simple_events,
        ls_event type cntl_simple_event.
*&---------------------------------------------------------------------*
*&       Class CL_EVENT_HANDLER
*&---------------------------------------------------------------------*
*        Text
*----------------------------------------------------------------------*
class cl_event_handler definition.
  public section.
    class-methods:
    handle_doclist_resize for event size_control
    of cl_gui_docking_container.
endclass.               "CL_EVENT_HANDLER
*----------------------------------------------------------------------*

* Create left docking container
create object ao_docking_container_left
  exporting
    side = cl_gui_docking_container=>dock_at_left
    extension = 600
    dynnr = '0100'
    repid = sy-repid.

ls_event-eventid = 12.
ls_event-appl_event = 'X'.
append ls_event to lt_events.

call method ao_docking_container_left->set_registered_events
  exporting
    events                    = lt_events
  exceptions
    cntl_error                = 1
    cntl_system_error         = 2
    illegal_event_combination = 3
    others                    = 4.

set handler cl_event_handler=>handle_doclist_resize
  for ao_docking_container_left.

call screen 100.
*&---------------------------------------------------------------------*
*&       Class (Implementation)  cl_event_handler
*&---------------------------------------------------------------------*
*        Text
*----------------------------------------------------------------------*
class cl_event_handler implementation.
  method handle_doclist_resize.
*Handles tree resizing
    data: lv_result type sysubrc,
          lv_width type i.
    call method ao_docking_container_left->get_width
      importing
        width      = lv_width
      exceptions
        cntl_error = 1
        others     = 2.

    leave program.
  endmethod.                    "handle_doclist_resize

endclass.               "cl_event_handler

include zmmm_dock_status_0100o01.

include zmmm_dock_user_command_0100i01.

Read only

0 Likes
1,510

See this code

* create the docking container
    CREATE OBJECT docking
                  EXPORTING repid     = repid
                            dynnr     = dynnr
                            side      = docking->dock_at_left
                            extension = 180.

This should be written in PBO of the screen.

See this sample code too <b>RSDEMO_DOCKING_CONTROL</b>.

Read only

Former Member
0 Likes
1,511

Hi Mikola,

Docking Container Resize is a Controls Framework event and is handled inside CL_GUI_CFW class (HORIZONTAL_RESIZE method).

I do not think we will be able register for this event and hanlde it as Framewrk events are system events handled by CL_GUI_CFW.

Sri

Read only

Former Member
Read only

0 Likes
1,510

try to register the event using method

REG_EVENT_SIZE_CONTROL of

CL_GUI_DOCKING_CONTAINER class.

Regards

Raja

Read only

0 Likes
1,510

> try to register the event using method

>

> REG_EVENT_SIZE_CONTROL of

>

> CL_GUI_DOCKING_CONTAINER class.

>

I have tried to use both ways: (1) register the SIZE_CONTROL event particulary by calling REG_EVENT_SIZE_CONTROL method and (2) register it via events table.

May be, this event is not able to be registered because of its being handled by Control Framework (SIZE_CONTROL event is derived from CL_GUI_CONTROL class)???