on 07-14-2014 11:40 AM
I'm try this in wddobeforeaction() with the code:
DATA: lo_api_controller TYPE REF TO if_wd_view_controller,
lo_action TYPE REF TO if_wd_action.
lo_api_controller ?= wd_this->wd_get_api( ).
lo_action = lo_api_controller->get_current_action( ).
IF lo_action IS BOUND.
IF lo_action->name EQ 'SEND'.
"code
ENDIF.
ENDIF.
But not works. lo_action->name is initial and lo_action is not bound.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alberto,
With the code you have used, it is not possible to get the desired action , since wd_this->wd_get_api( ) refers to current view.
Instead a node can be used which can store the value of the button pressed, so that the button value can be passed from one view to another, through context mapping,.
Regards,
Harsha
Hi Alberto,
Here, you need to store the action name/ action reference in the component controller, so that it can be accessed in any view.
Let us say, you have embedded the VIEW2 inside the VIEW1 and VIEW1 has buttons SUBMIT, RESET, etc
Whenever an action occurs, the method WDDOBEFOREACTION( ) of VIEW1 gets triggered first and then of VIEW2.
So, the action of VIEW1 can be saved in component controller and then can be accessed in VIEW2.
Example:
- Create an attribute GV_VIEW1_ACTION_NAME in component controller
- write the below code in wddobeforeaction( ) of VIEW1
DATA: lo_api_controller TYPE REF TO if_wd_view_controller,
lo_action TYPE REF TO if_wd_action.
lo_api_controller ?= wd_this->wd_get_api( ).
lo_action = lo_api_controller->get_current_action( ).
clear wd_comp_controller->gv_view1_action_name.
IF lo_action IS BOUND.
wd_comp_controller->gv_view1_action_name = lo_action->name.
ENDIF.
- now, access the current action of view1 inside VIEW2 as below
if wd_comp_controller->gv_view1_action_name = 'SEND'.
" do your logic
endif.
Hope this helps you.
Regards,
Rama
Ok!
Thank you for your answers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.