on 01-09-2008 12:51 PM
Hi There,
Just wondering if anyone can explain to me how i capture what button a user pressed when using the method 'cl_wd_popup_factory=>popup' and how I perfor different methods/ functionality depending on what they pressed.
At the moment i can create the popup using the code below but it is not displayed untill the current method has been completed, at this point it seems too late to allow me to control of the code.
call method cl_wd_popup_factory=>popup
EXPORTING
component = lr_component_api
view_name = 'VIEW2'
button_kind = if_wd_window=>CO_BUTTONS_YESNO
message_type = if_wd_window=>CO_MSG_TYPE_QUESTION
IMPORTING
POPUP_WINDOW = window
COMPONENT_USAGE = comp_usage.
Any ideas would be much appreciated
Regards
Martin
Hi Mart,
the source code for open_popup in the component controller is:
data:
lr_api_comp_controller type ref to if_wd_component,
lr_window_manager type ref to if_wd_window_manager.
lr_api_comp_controller = wd_this->wd_get_api( ).
lr_window_manager = lr_api_comp_controller->get_window_manager( ).
e_popup = lr_window_manager->create_window(
MODAL = ABAP_TRUE
window_name = i_popup_name
TITLE = TITLE
CLOSE_BUTTON = ABAP_TRUE
BUTTON_KIND = i_button_kind
MESSAGE_TYPE = i_message_type
CLOSE_IN_ANY_CASE = ABAP_TRUE
MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
).
e_popup->open( ).
Regards,
Rainer
Edited by: Rainer Liebisch on Jan 9, 2008 4:59 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Rainer,
That has worked a treat, i used the CREATE_WINDOW method directly rather than using it viw the OPEN_POPUP method but should not make any different should it? see code below
Thanks again
Regards
Martin
data: lr_popup type ref to if_wd_window,
lr_view_controller type ref to if_wd_view_controller.
data:
lr_api_comp_controller type ref to if_wd_component,
lr_window_manager type ref to if_wd_window_manager.
lr_api_comp_controller = wd_comp_controller->wd_get_api( ).
lr_window_manager = lr_api_comp_controller->get_window_manager( ).
lr_popup = lr_window_manager->create_window(
MODAL = ABAP_TRUE
window_name = 'WND_TEXT'
TITLE = 'TITLE '
CLOSE_BUTTON = ABAP_TRUE
BUTTON_KIND = if_wd_window=>co_buttons_okcancel
MESSAGE_TYPE = if_wd_window=>co_msg_type_none
CLOSE_IN_ANY_CASE = ABAP_TRUE
*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
).
lr_view_controller = wd_this->wd_get_api( ).
lr_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
button_text = 'ok_text'
action_name = 'SUBMIT'
action_view = lr_view_controller ).
lr_popup->open( ).
Hello Mart,
don't use the deprecated method of CL_WD_POPUP_FACTORY. The recommended way is:
data:
lr_popup type ref to if_wd_window,
lr_view_controller type ref to if_wd_view_controller.
wd_comp_controller->open_popup(
exporting
i_popup_name = 'WND_TEXT'
i_button_kind = if_wd_window=>co_buttons_okcancel
i_message_type = if_wd_window=>co_msg_type_none
importing
e_popup = lr_popup ).
lr_view_controller = wd_this->wd_get_api( ).
lr_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
button_text = 'ok_text'
action_name = 'MY_ACTION'
action_view = lr_view_controller ).
lr_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_cancel
button_text = 'cancel_text'
action_name = 'MY_ACTION'
action_view = lr_view_controller ).
lr_popup->set_on_close_action( view = lr_view_controller action_name = 'MY_ACTION' ).
Regards,
Rainer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.