2005 Oct 17 8:35 AM
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).
2005 Oct 17 10:06 AM
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).
2005 Oct 17 9:19 AM
Hi,
Where is the class definition and implementation for handling that event?
2005 Oct 17 9:44 AM
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.
2005 Oct 17 9:48 AM
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.
2005 Oct 17 9:49 AM
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>.
2005 Oct 17 10:06 AM
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
2005 Oct 17 10:42 AM
Hi,
check this may be it can help you...
http://help.sap.com/saphelp_erp2004/helpdata/en/d3/2955360b00a115e10000009b38f839/frameset.htm
regards,
venu.
2005 Oct 17 12:05 PM
try to register the event using method
REG_EVENT_SIZE_CONTROL of
CL_GUI_DOCKING_CONTAINER class.
Regards
Raja
2005 Oct 17 1:16 PM
> 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)???
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |