[WEB] Trigger popup button from parent

[WEB] Trigger popup button from parent

  

Hi,


So far I have a popup that has a button which triggers an Screen Action once clicked. Until here everything is ok, the problem started once they told me to get rid of the popup ( close it ) whenever the user clicks outside the popup.


So yes, I made it so that the popup gets closed once the user clicks outside the window with:

"<script>

$('body').click(function(){
  RichWidgets_Popup_Editor_Close();
});

</script>"


The problem is that even though the popup is successfully closed, I'm not able to call the popup_editor_notify in order to trigger the Screen Action mentioned before so what I basically need is either call/trigger the popup's button whenever the user clicks outside the window ( the popup ) or calling the popup_editor_notify before closing it.


I've tried something like "RichWidgets_Popup_Editor_Notify(); before calling  RichWidgets_Popup_Editor_Close(); but it didn't work at all.

P.s: useful links that may help but didn't work for me though:

https://www.outsystems.com/forums/discussion/32941/access-popup-using-javascript/

https://stackoverflow.com/questions/1088544/get-element-from-within-an-iframe



Thank you all by advance,

Jordi.

Hi Jordi,

This is what you get when you try to work around the Platform instead of convincing your clients that something is not possible given a certain platform :).

As for the notification, when I try in the Chrome devtools to search for richwidgets_popup I get the following list:

Perhaps try the _notifyWidget one? I've never used it myself, so I don't know whether it works.

Kilian Hekhuis wrote:

Hi Jordi,

This is what you get when you try to work around the Platform instead of convincing your clients that something is not possible given a certain platform :).

As for the notification, when I try in the Chrome devtools to search for richwidgets_popup I get the following list:

Perhaps try the _notifyWidget one? I've never used it myself, so I don't know whether it works.


Hi Kilian,


richwidgets_popup_editor_notifyWidget is just a string, if I use it on Chrome's console it will return " "wt10_wtMainContent_wtMensajesTable_ctl03_CloneOfRichWidgets_wtMsgPopup_block" " so I guess it won't work this way.


By the way, I found this thread ( https://www.outsystems.com/forums/discussion/17221/call-an-action-when-close-a-popup-window-how-to-associate-it/ ) and it seems that this guy had the same problem as I'm having now but he got himself to solve it. The bad thing is I don't really know what he is talking about and where I should set that unload extended property.


Could you please help me as you have my .oml project in the PM I sent you yesterday ?

edit: seriously, where am I supposed to set the "unonload" extended property? I can't find it.


Thank you kindly,

Jordi.

Hi Jordi,

I'm also not sure on which widget Luciano set it, perhaps you can ask him?

Solution

Kilian Hekhuis wrote:

Hi Jordi,

I'm also not sure on which widget Luciano set it, perhaps you can ask him?

Hi Kilian,


I fixed it myself somehow:




I just went really mad and tried to set onunload extended property on the popup screen even though there is no "onunload" option showing up...


So yeah, it works almost perfect and when I say almost is beucase this workaround doesn't work for Internet Explorer while it does for Chrome, Edge, Firefox....


Also, this new workaround messes up the button that was fully working before.


Jordi.

Solution

Well, the onunload might interfere with the normal code executed on unloading. But it's a bit of a hack of course, so that it doesn't work completely doesn't surprise me.

Kilian Hekhuis wrote:

Well, the onunload might interfere with the normal code executed on unloading. But it's a bit of a hack of course, so that it doesn't work completely doesn't surprise me.


Yes, I got rid of my working button + Screen Action and replaced it with the standart "X" popup close button.