Popup window close button does not fire an event?

Popup window close button does not fire an event?


The upper-right cross does not fire an event that window is closes.
Is there an explicit reason why that is the case?

I have a wizard which can be aborted ofcourse, either with an explicit abort-button or the cross.
Ofcourse I can hide the button, but I find that a bit strange for a popup.

So possible I need to add my own events to that cross, but I really wonder why it's not in there by default.

Or I am missing something obvious...
Dear Joost,

have you tried the Popup_Editor_Notify Widget? You can use it to trigger an action... On the parent screen you can then have an action to do whatever you want.
Thanks for the suggestion, but that will not solve that specific problem.

On button I can do that, because I can hook an action to that.
However, the cross (X) is rendered by the richwidget and I cannot hook up an action to that, without actually modifying the code itself.
Hi Joost,

if i understand your goal, it is possible to do by adding to the extended properties of the popup screen the 

followed by the value
"parent.OsNotifyWidget(parent.RichWidgets_Popup_Editor_notifyWidget,'" + EncodeJavaScript("closed
") + "');"

where the "closed" is the notify message to be used by the NotifyWidgetGetMessage on your PopUp OnNotify action.

Let us know about it, and if you want some working example of my approach tell me and i'll upload it.

Miguel Antunes
Yeah, that works.


I expected it, but now I have 2 events bubbling in the parent when clicking a button, so need to handle that properly

Why Not close Pop-up Windows after click on Clost Button.
 My Pop-up WIndows two Dropdown List and after one dropdown list changed Index then second dropDown list Value also changed after I click on close button then
not close Pop up Windows

if I click on Close button without change of DropDown List Index it work properly.

Please tell me  Problem and solution on it.  

I tried the solution that you gave but i had no success.

Do you have an example to see?

Hi Rodrigo and welcome to the Outsystems Community!

Yes i can provide you a sample eSpace, tell me just wich version of Service Studio are you using so i can create it in that version.

I'm using version
Agains thanks for the help.

Take the attached example.

Take a look at UserMaster_PopupEditor WebScreen extended properties, this should work, i cannot test it cause rigth now i don't have a 5.1 Server to publish it.

let us know if this works.

Miguel, I tried the file and your example does not work. I tried to run your eSpace and it did not refresh after closing the PopUp. Don't know if the problem is related with this version of Service Studio. I will try to find another way to solve this, but any help is welcome. Again thanks for the help.
Hi Rodrigo,

i've managed to publish my eSpace to be able to test it and i've set a breakpoint in the action RefreshUserMasterTable, and after i hit the "X"  the breakpoint was reached, meaning that the close event was fired.

Take another look and check if you didn't miss any part of the logic.

Hi Miguel,

I tried your example and i had the same problem like Rodrigo, i saw my code various times and I don't see where is the problem. I have more popup window in the screen, the problem will be there?  Is this property correct?

"parent.OsNotifyWidget(parent.RichWidgets_Popup_Editor_notifyWidget,'" + EncodeJavaScript("closed") + "');"

Thanks for the help.

Hi Miguel.
I run your eSpace and did the same thing (debug with breakpoint in the refresh action) but unfortunately when i pressed the cross and closed the windows it did not trigger the action. I need to know if someone opened the PopUp due to security reasons and need to refresh the page after, that's why i must fix this problem. I can't find a reason why it works for you and not for me. Do you have any idea of what can be causing my problem? 
Anyway thanks for all the help so far.
Rodrigo Henriques
Hi Rodrigo,

Probably by now you have already a solution, but we came across the same problem and were able to solve it.
Our platform version is, don't know if it makes a diference.
We were not able to work with the "onunload", but changed it to "onbeforeunload" and it works perfectly.
With the "onload", the event is trigered, but the OnNotify dosen't work.

Kind regards