cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Radhika,

Thanks for your input.

When i created an attribute in component controller and try to bind it in the view of the popup it is not allowing.

How to create an attribute and make it public? Since am new to webdynpro can u plz explain.

Sorry for the trouble.

Former Member
0 Kudos

And also plz tell if the type of this attribute is STRING or any other type should be used.

If i click on the attribute go_window in component controller, i am not able to find any option to make it public.

Where will this option be available.

Edited by: Mohamed Aslam on Aug 1, 2009 7:29 AM

Former Member
0 Kudos

I found the place of where to create attribute.

I am giving the attribute name as 'GO_WINDOW'

What name should be given ifor ASSOCIATED TYPE?

Can someone help me?

Thanks in advance.

uday_gubbala2
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank u everyone