cancel
Showing results for 
Search instead for 
Did you mean: 

Pop up events

Former Member
0 Kudos

Hi,

I am able to open pop up, but i need to capture the event when user clicks on "OK" or "Cancel" button.

How can do that. Below is my piece of code.

data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component type ref to if_wd_component.

data lo_window type ref to if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window = lo_window_manager->create_window(

window_name = 'ZDYNAMIC'

title = 'Dynamic Data'

  • close_in_any_case = abap_true

message_display_mode = if_wd_window=>co_msg_display_mode_selected

  • close_button = abap_true

button_kind = if_wd_window=>CO_BUTTONS_OKCANCEL

message_type = if_wd_window=>co_msg_type_none

default_button = if_wd_window=>co_button_ok

).

lo_window->open( ).

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi vimal........

there is a method called SUBSCRIBE_TO_BUTTON_EVENT in if_wd_window.... you can make use o fthis method to subscribe for an event and make it function as you like..... when you create your external window it returns a window of type if_wd_window.... use this as an instance and proceed further.

---regards,

alex b justin

Former Member
0 Kudos

Hi..

Can you please brief it little bit.

where to write this piece of code?

Former Member
0 Kudos

hi vimal.......

you can call this method before calling lo_window->open( ). you should send the button name, action name and the view controller name.

---regards,

alex b justin

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Use this after your code and create two action OK & CANCEL

and in ONACTIONOK write code what u want to do on clicking on Ok button and same for Cancel.

DATA lo_action_view TYPE REF TO if_wd_view_controller.

lo_action_view = wd_this->wd_get_api( ).

lo_window ->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

action_name = 'OK'

action_view = lo_action_view

is_default_button = abap_true ).

lo_window->subscribe_to_button_event(

button = if_wd_window=>co_button_cancel

action_name = 'CANCEL'

action_view = lo_action_view

is_default_button = abap_false ).

lo_window->open( ).

It will work fine

Regards,

Varun