on 05-16-2012 2:12 PM
HI friends,
I have some input validations in dobeforeaction hook method. In my view I have a save and cancel button, when i click on save it is performing input validations
before saving that's fine but when I click on cancel button it should skip this validations and navigate to next view. Could you please tell me how could I perform this?
Hi Veera,
You can do this by getting the action name of clicked button. check the below code.
method WDDOBEFOREACTION .
data lo_api_controller type ref to if_wd_view_controller.
data 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.
case lo_action->name.
when 'SAVE'. " here SAVEis the action name for button Save
* Do code for Validation
When 'CANCLE'. " here CANCLE is the action name for Cancle
* Do nothing.. or clear the fields if required
endcase.
endif.
endmethod.
Hope this helps u.,
Revert back incase of further clarifications
Thanks & 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 Veera,
Just u create one method copy all ur logic which ther in WDDOBEFOREACTION method and comment it and on action of SAVE call that method.
So that it only check for SAVE action but not for cancel action. By this way u can bypass for CANCEL action.
Regards,
Farooq
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.