Please find the list of step need to perform to achieve the handling of event from source view to target view .
Step 1 . Identify the source view from where the event will be triggered.
Step 2 . Identify the target view where the event should be handled.
Step 3 . Register the listener name, handle name , controller and event name in the targeted view .
· Listener name – name of the view where even will be handled.
· Handler name – the method in the target view which will handle the event raised in source view
· Controller name – Name of the component controller used.
· Event name – Name of the event which is raised.
Sample code for target view written in DOINIT method .
DATA: lo_componentcontroller TYPE REF TO ig_componentcontroller,
lo_api_componentcontroller TYPE REF TO if_wd_component.
lo_api_componentcontroller->add_event_handler(
listener_name = 'V_MAIN'
handler_name = 'OK_HANDLE_MAIN'
controller_name = 'COMPONENTCONTROLLER'
event_name = 'OK_CLICKED_MAIN' ).
Step 4 . you want the target view to handle the source view event just raise the event which is declared in component controller like below :
wd_comp_controller->fire_ok_clicked_main_evt( ) .
Resultant : Now once the ok_clicked_main event is raised from source view , the same event can be handled in the target view method OK_HANDLE_MAIN . You can perform any action/population in this method .