Popup close and refresh data+adjax refresh on parent screen

Popup close and refresh data+adjax refresh on parent screen

  

Hi there, 

I have a small question. When I save information from a popup screen, it gets written to an entity. 

Thereafter, I close the popup so that I am back on the screen that called the popup (I will call this the parent screen). 

All I want to do is refresh a specific aggregate (which fetches data entity that has just been written to) and call an adjax refresh on a specific input so that a list is available to the user. 

The problem: I don't want to have to call the preparation again for the parent screen but only want to refresh a specific entity and widget. However, I can't do this (adjax refresh or entity refresh) from the scope of the popup (I only see actions within the popup scope), so how do I do the refreshing without calling the preparation (by calling preparation I mean simply redirecting back to the parent screen) of the parent? 

Kind regards, 

Cole

Hi Cole, 

While closing a pop-up you need to add an action called Notify Action from the system and pass some argument may a small text for example.

In your parent screen created a action called onNotify 

In the onNotify action, add NotifyGetMessage action and check for the same argument that you have passed in the Notify action during pop-up close.

after Check you need to add the refresh action that will refresh your necessary widgets in the parent screen.

for reference i have added this onnotify action looks like



Solution

Hi Cole,

What you do in these kind of situations is use the Popup_Editor_Notify Action from RichWidgets just before the Popup_Editor_Close.

This will make the On Notify Destination property of the RichWidgets\Popup_Editor in the parent Screen available and mandatory. You specify a Screen Action there that is automatically Ajax called, and you put your refresh in there.

Solution

Kilian Hekhuis wrote:

Hi Cole,

What you do in these kind of situations is use the Popup_Editor_Notify Action from RichWidgets just before the Popup_Editor_Close.

This will make the On Notify Destination property of the RichWidgets\Popup_Editor in the parent Screen available and mandatory. You specify a Screen Action there that is automatically Ajax called, and you put your refresh in there.


Thanks Kilian. Problem solved :)!! 

Hi Cole,

Great to hear! Happy coding :).

Kilian Hekhuis wrote:

Hi Cole,

What you do in these kind of situations is use the Popup_Editor_Notify Action from RichWidgets just before the Popup_Editor_Close.

This will make the On Notify Destination property of the RichWidgets\Popup_Editor in the parent Screen available and mandatory. You specify a Screen Action there that is automatically Ajax called, and you put your refresh in there.


Hi Kilian,


I'm at the same point that Cole was when he opened this thread. So, if I close my popup by clicking on the top right "X", where should I use the Popup_Editor_Notify?


Jordi.

Hi Jordi,

When you close your pop-up with the "X", that's the same as closing a Tab in your browser: the pop-up/screen gets killed and that's that. It's like a forced "Cancel". You cannot intercept that.

Kilian Hekhuis wrote:

Hi Jordi,

When you close your pop-up with the "X", that's the same as closing a Tab in your browser: the pop-up/screen gets killed and that's that. It's like a forced "Cancel". You cannot intercept that.

Hi Kilian,


Well, that makes a lot of sense. So yeah, I've just added a button to the popup layout, did as you explained before and it worked.


By chance, is there any way to get rid or hide the top right X on the popup ?


Thank you,

Jordi.


Hi Jordi,

Whether or not the X is shown is determined by the Popup_Editor Web Block's "HideCloseButton" parameter (if it's True, no X is shown).