cancel
Showing results for 
Search instead for 
Did you mean: 

Close Pop up not working

florian_royer
Participant
0 Kudos

Dear experts,

we are facing the following issue:

we create an external window using window manager.

wd_this->go_window  = lo_window_manager->create_window(
                      window_name            = 'WI_XXX
                      title                  = XXX
*                      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_ok
                      message_type           = if_wd_window=>co_msg_type_none
*                      default_button         = if_wd_window=>co_button_ok
*                      default_button         = if_wd_window=>co_buttons_okcancel
                       ).

We assigned an action to the pop up ok button.

wd_this->go_window->subscribe_to_button_event(
                 button            = if_wd_window=>co_button_ok
                 action_name       = 'POPUP_OK_XXX
                 action_view       = lo_view_controller "wd_this->wd_get_api( )
                 is_default_button = abap_true ).

Clicking on OK Button, the action fires - the code is working fine.

But: after our code is finished, the screen has to be refreshed. We fired an exit plug of the current window, providing the url of the current application. This is working fine too, but the pop up window is still open and modal, even if we invoke the close method of the popup window directly before fireing the exit plug. In the background we can see the refreshed application, but it is not possible to do anything.

Does anyone have a solution for this?

We tried setting close_in_any_case to true and so on ... but nothing works.

The problem occurs both create_window and pop_up_to_confirm ...

Regards, Florian

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

>

> But: after our code is finished, the screen has to be refreshed. We fired an exit plug of the current window, providing the url of the current application. This is working fine too, but the pop up window is still open and modal, even if we invoke the close method of the popup window directly before fireing the exit plug. In the background we can see the refreshed application, but it is not possible to do anything.

>

> Does anyone have a solution for this?

>

> We tried setting close_in_any_case to true and so on ... but nothing works.

> The problem occurs both create_window and pop_up_to_confirm ...

>

> Regards, Florian

Hi Florian,

I am sure by this time you are fed up with everyone's questions and your problem still exists.

I assume that in your code that you have saved the window reference of the popup before you actually open it.

Have you tried closing this saved window before you fire exit plug. I would suggest to comment the line of exit plug for time being to make sure that you are able to close your popup window.

If it is working fine then you can try enabling the exit_plug.

Former Member
0 Kudos

The following might help those with similar issues.

DATA: l_api           TYPE REF TO if_wd_view_controller,
      l_window_ctlr   TYPE REF TO if_wd_window_controller,
      l_popup         TYPE REF TO if_wd_window.

l_api = wd_this->wd_get_api( ).
l_window_ctlr = l_api->get_embedding_window_ctlr( ).
l_popup = l_window_ctlr->get_window( ).
l_popup->close( ).

alejiandro_sensejl
Active Participant
0 Kudos

Hi Florian,

have you tried this?


DATA:
  l_api TYPE REF TO if_wd_view_controller, 
  l_window_ctlr TYPE REF TO if_wd_window_controller, 
  l_popup TYPE REF TO if_wd_window.
" get embedding window
  l_api = wd_this->wd_get_api( ). 
  l_window_ctlr = l_api->get_embedding_window_ctlr( ).
" and close the pop up
IF l_window_ctlr IS BOUND. 
  l_popup = l_window_ctlr->get_window( ). 
  l_popup->close( ). 
ENDIF.

I had some problems closing popups myself until finding this great snippet that helped me a lot!

Check article [Quick Tips andTtricks on Web Dynpro for ABAP - How to use ALV and Pop Ups|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4] of Joris Bots for better formatting and a lot more great information!

Regards,

Alej

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>we create an external window using window manager.

An External Window or a Dialog Window? Your coding would be that for a dialog window, but the description of the way it is working sounds like an external window.

A truely modal external window (separate browser instance, not just a floating iFrame within the current browser canvas) is a separate user sessions on the backend and can not be controlled or closed from the originating application.

florian_royer
Participant
0 Kudos

Oh, I am sorry - we created a truely modal dialog window, and not an external window with as mentioned above.

Therefore it has no separate browser instance and session.

Former Member
0 Kudos

Hi,

Try like that....

step1) create an attribute (say lo_popup_window) at the component level of type IF_WD_WINDOW make sure you check both check boxes (public) and (ref to)....you need to go to your component controller....click on attribute tab and create this....

step2)...now in your code do following...where you are trying to create and open the popup:


wd_comp_controller->lo_popup_window = wd_this->go_window.
wd_this->go_window->open( ).

step3)...in your close window btn....write this:



DATA:l_final_window TYPE REF TO if_wd_window.

  l_final_window = wd_comp_controller->lo_popup_window.

  IF l_final_window IS NOT INITIAL.
    CALL METHOD l_final_window->close( ).
  ENDIF.

this should close your window

Thanks...

AS...

florian_royer
Participant
0 Kudos

Hey,

thx for your valuable answer.

>

> step1) create an attribute (say lo_popup_window) at the component level of type IF_WD_WINDOW make sure you check both check boxes (public) and (ref to)....you need to go to your component controller....click on attribute tab and create this....

>

we already tried that.

>

> IF l_final_window IS NOT INITIAL.

> CALL METHOD l_final_window->close( ).

> ENDIF.

>

>

It doesn't close ... neither window created by "Create_window" nor Pop_up_to_confirm.

Seems like the code for closing the dialog window is never executed.

Former Member
0 Kudos

Hi,

alright..in this case i would say create your own close btn on the view you are embeding inside this pop-up window and try to close the window in its action method....

here is the code to get rid of all the standard btns:


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            = 'POPUP_WINDOW'
                         title                  = title_txt
*                         close_in_any_case      = abap_false
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                   close_button           = abap_false
*                   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->lo_popup_window = lo_window.

      lo_window->open( ).

Thanks..

AS

Former Member
0 Kudos

Did you try using the Close method, for eg: wd_this->go_window->close( )

florian_royer
Participant
0 Kudos

Hello,

thx for your reply.

Yes, we already tried to invoke that method. Did not change anything!