Skip to Content
avatar image
Former Member

pop up window closing problem when i have two popup window opened

Hi,

I have the following scenario.

When i click a button in screen, a pop window (popup window1) will open.

In this popupwindow1 i click on a button 'YES' another popup window (popup window2) will open.

Now when i click the button 'DELETE' in popup window2, i do some action and then i have to close this window.

So i write the following code for closing the popup window2 in the button 'DELETE'.

lo_api = wd_this->wd_get_api( ).

lo_window_ctlr = lo_api->get_embedding_window_ctlr( ).

lo_window = lo_window_ctlr->get_window( ).

lo_window->close( ).

But after this the popupwindow1 is still open. - How to resolve this issue?

If i put the same code in the button 'YES' of popupwindow1, the popupwindow1 is closing on clicking 'YES' but popup window2 is not opening.

Thanks a lot

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 01, 2009 at 04:41 AM

    Hi, Inorder to close Popup 1 from Popup 2 you should have the reference of Popup1's window . So i would suggest when you create popup 1, store the reference of Popop 1 in a global attribute. So firstly create an attribute in component controller i.e go_window and mark it as public. Now when you call popup 1 .. save your Popup1 window refernce in this attribute as follows;

    wd_comp_controller->go_window = lo_window.
    lo_window->open( ) .
    Now in your Popup 2, in the Action of 'DELETE' button you can close the Popup 1 as follows
    wd_comp_controller->go_window->close( ).
    Regards, Radhika.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Mohammed,

      You need to save the reference of your Window inside the attribute so make it as: TYPE REF TO and not just any ordinary type. So you do something like:

      BOOKINGS_VIEW TYPE REF TO IF_WD_WINDOW

      You need to checkmark the 2 checkboxes "Public" & "RefTo" in order to define it in this way. Now when you are just about to call your popup you must save the window reference into your componentcontrollers attribute. So you would have something like:

      lo_window         = lo_window_manager->create_window(
                           window_name            = 'BOOKINGS'
                           message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                           button_kind            = if_wd_window=>co_buttons_ok
                           message_type           = if_wd_window=>co_msg_type_none
                           default_button         = if_wd_window=>co_button_ok
                           ).
      
        WD_COMP_CONTROLLER->bookings_window = lo_window.
        lo_window->open( ).

      So just before you call your 2nd popup save the windows reference into the componentcontroller attribute & then you can access the same attribute from your 2nd popup and say something like:

      wd_comp_controller->bookings_window->close( ).

      Hope that this would help resolve your problem.

      Regards,

      Uday

  • avatar image
    Former Member
    Aug 01, 2009 at 08:25 AM

    Thank u everyone

    Add comment
    10|10000 characters needed characters exceeded