on 06-26-2009 1:40 PM
Hi all,
I have a requirement where i have a button on clicking which a popup will open. Now i want to write an action method in the OK button of the popup. This OK button is the standard one that comes automatically for the popup.How and where can i write the method. Please help..
Hi Abhishek,
Here are the steps:
1. Create and call the window manager
l_api_main = wd_this->wd_get_api( ).
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
l_popup = l_window_manager->create_popup_to_confirm(
text = lt_texts
button_kind = if_wd_window=>co_buttons_yesno
message_type = '5'
window_title = 'Confirm Delete Group' ).
For OK button
l_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_yes
action_name = 'OK'
action_view = l_api_main
is_default_button = abap_true ).
Same for Cancel button
l_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_no
action_name = 'CANCEL'
action_view = l_api_main
is_default_button = abap_false ).
2. Call the window
l_popup->open( ).
3. Write the action handler
Create two actions OK and CANCEL in the Actions tab.
Write the necessary code for each of them.
Hope this was helpful.
Regards,
Arpan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
when you write the code to call the popup, subscribe to the event for ok button as follows,
lo_window->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
action_name = 'OK' " goto actions tab and create an action with the same name and place the required code
action_view = l_api
is_default_button = abap_true ).
lo_window->open( ).
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.