cancel
Showing results for 
Search instead for 
Did you mean: 

Which event ir triggered in the caller view, after a popup is closed?

Former Member
0 Kudos

Hi!

I have 2 windows, WMAIN and WPOPUP, and 2 views, VMAIN and VPOPUP. WMAIN contains VMAIN view and the WPOPUP contains the VPOPUP view.

The popup is called from the main with a buttonclick. I'm using the default OK/Cancel buttons for the popup.

The popup is working already correctly, but now I would like to run some methods in the VMAIN view, when the VPOPUP is closed with the press of the 'OK' button.

Is there a way to handle it? Which event is tirggered in the caller VMAIN view, when the popup is closed?

Closing is asynchronous of course...

Thank you

Tamá

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi, Tamás.

For your requirement, there are many ways to realize it in WD.

Just as Thomas Jung said, you can use "subscribe_to_button_event" to the button "OK" of Pop-up, then in the handler you can execute your another method of your view "VMAIN".

For example, in your action of VMAIN which will open the pop-up, you use:


lo_window->popup_to_confirm->subscribe_to_button_event(
            controller         = lo_api_comp
            handler_name       = 'HNDL_POP_OK'
            button             = if_wd_window=>co_button_ok ).

Then in the handler 'HNDL_POP_OK' which you should add yourselft in the method list of VMAIN, you can call your method of the VMAIN.

In addition, you can also make use Event, which you can trigger the event when you close the Pop-up, then you can catch the event in your VMAIN. For detail ,you can search this forum,for example, the event in WD.

Hope it can help you a little,

Best wishes.

former_member450736
Active Participant
0 Kudos

Hi,

if i am not wrong you can use "WDDOCLOSE" hook method of WPOPUP which is triggered when this window WPOPUP is closed as Popup.

so what you can do trigger an event of component controller in this method ("WDDOCLOSE" hook method of WPOPUP), and write event handler for this event in the VMAIN and run methods in this event handler.

Thanks,

Kranthi.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can register a callback event handler for the close button at the time that you create the popup window. Use the SUBSCRIBE_TO_BUTTON_EVENT or the SET_ON_CLOSE_ACTION methods of the Window (of the Popup) to register the callback.