on 02-28-2014 5:44 AM
Hi Experts,
Can anybody tell me how to call Event handler Method which is declared in View A ,it Should be Called in
view B,Thanks in Advance.
Thanks & Regards
Santhosh
Hi Sandesh,
You can call event handler method of View 1 in View 2 as below
- Go to events tab of component controller and create an event "ON_CLICK" in component controller
- Create a method RAISE_EVENT_CLICK in component controller and write the below code
CALL METHOD wd_this->fire_on_click_evt( )
- Now, in view1 create an event handler method ON_SELECT and bind it to the event of component controller as below
- Go to VIEW 2 and call the component controller method as below
wd_comp_controller->raise_event( ).
Now, the event handler method in VIEW1 gets called
-----------------------------------
If you just have to perform the common action of VIEW1 in VIEW2, As suggested by
Create a method in component controller and move the logic to that method ex: DO_ACTION1 and call in all views as below
WD_COMP_CONTROLLER->DO_ACTION1( ).
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Place the event handler method code of view A in Component controller method and call the component controller method in View B using wd_comp_controller->viewA_method( ).
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
1) You can make the method EH_ONSELECT as public and static and call this method in viewGS_CM/ADDDOC using syntax
impl class name of view GS_CM/DOCTREE=>EH_ONSELECT "method name.
or
2)The view GS_CM/ADDDOC which contains EH_ONSELECT method has been already enhanced, so I can't execute such kind of operation one more time.
or
3)If both views or viewarea containing that view are under same window , then you can get the instance ofGS_CM/DOCTREE from view GS_CM/ADDDOC through the main window controller.
lr_window = me->view_manager->get_window_controller( ).
lv_viewname = 'GS_CM/DOCTREE '.
lr_viewctrl ?= lr_window ->get_subcontroller_by_viewname( lv_viewname ).
Now you can access the method of view GS_CM/DOCTREE .
Let me know in case you face any issues.
Message was edited by: Laure Cetin Please do not ask for points, this is against the Rules of Engagement: http://scn.sap.com/docs/DOC-18590
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.