cancel
Showing results for 
Search instead for 
Did you mean: 

closing a popup window

Former Member
0 Kudos

HI all,

I have created a popup window and it has a 'OK' button by default.

Now i want to write some logic when i click this default OK button. So where to write the coding?.

Also, i want to close the popup window when i click that OK button.

Can anyone provide me the coding for closing the popup window?

Regards,

Shanthi

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

The Subscribing code should be written in the WDDOINIT method of the View.

Former Member
0 Kudos

Hi,

For writing any code on the click of OK button, u have to create an action. Go to action tab and create an action say OK_POPUP.

Now use method subscribe_to_button_event of wondow to create action for OK button, as amit has explained.

Now in the OK_POPUP action write ur logic for Ok button and at the end for closing the pop-up use the following code.

data lo_view_controller type ref to if_wd_view_controller.
  lo_view_controller = wd_this->wd_get_api( ).
  data lo_wdw_controller type ref to if_wd_window_controller.
  lo_wdw_controller = lo_view_controller->get_embedding_window_ctlr( ).
  data lo_popup_window type ref to if_wd_window.
  lo_popup_window = lo_wdw_controller->get_window( ).
  lo_popup_window->close( exporting delete_window = abap_true ).

Regards,

Pankaj Aggarwal

Former Member
0 Kudos
Former Member
0 Kudos

hi Shanthi ,

u must be obtaining ur pop up in ur view .suppose view1


lo_window->subscribe_to_button_event(
                 button            = if_wd_window=>co_button_yes
                 action_name       = 'OK_POPUP'
                 action_view       = l_api
                 is_default_button = abap_true ).

here action name is OK_POPUP

so in the method name ONACTIONOK_POPUP of view1 , write the appropriate coding which u want to perrform on OK button.

regards,

amit