cancel
Showing results for 
Search instead for 
Did you mean: 

Closing a Pop Up Window on click of a button

former_member184111
Active Contributor
0 Kudos

Hi Forum,

In the parent view there is a button, on click of this button a new pop up window is opened.

This pop up window also has a button (Submit). Onclick of the submit button in pop up window I need to performe some code execution and then close this pop up window.

I tried the steps given in the weblog

/people/mohammed.anzys/blog/2007/06/05/how-to-close-parent-window-in-webdynpro-applications

But it does not seem to be working.

Any other way to achieve this or what might I be doing wrong here?

Thanks,

Anubhav.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi.,

This Blog is to Close the Parent Window not the Popup Window..

If You are using create_popup_to_confirm() method of window., then no need to close the window externally., After execution of the Actions Specified it will colse.,

If you created a window ., then in component controller you create the attribute lo_window type ref to if_wd_window.,

then in Your view on click of button call the component reference and instantiate lo_window attribute and open window.,

and on click of submit button in the window., after code execution part use lo_window->close() method .

hope this helps u.,

Thanks & regards

Kiran

Answers (2)

Answers (2)

Former Member
0 Kudos

Kiran is right. If your concern is to close the popup then just before opening the popup save the instance in a component controller attribute and when you need to close this popup ,use the saved instance to call the close method.

former_member184111
Active Contributor
0 Kudos

Hi,

I missed a parameter in parent window while calling the pop up window

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_for_cmp_usage(
                   interface_view_name    = 'WD_VALUE_HELP'
                   component_usage_name   = 'ZUSAGE_FORMNUM'
                   title                  = 'Additional Information For Item'
                  close_in_any_case      = abap_true <----Missed this earlier
                   message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                   ).

lo_window->open( ).

Now it is working fine.

Many thanks to all.

former_member182598
Active Contributor
0 Kudos

Hi Anubhav,

You might like to refer this one

/thread/1918022 [original link is broken]

Thanks

Prashant