Parent Screen not refreshing after popup closes

Hi,

I am understanding how OS works and doing a sample application in OS 11.0

I have a web application, in which the employees form where I have added profile pic. To the extent I have implemented, on click of "Click to Add/Change image" link a popup is shown and user selects the image and clicks Save on the popup.

On this event, I was able to save the image to DB and close the popup; but i am not able to refresh the parent page so that the selected image is displayed.

I have added OnNofity action in the parent page where in i have added DataSource refresh and form refresh actions, but it is not working.

I have debugged and see that the control flow is going along but not sure what I am missing. Please find attached my .oml file.

Also, please use the link below to launch page; I have two EmployeeDetail web screens for which editing the employee will only take to EmployeeDetail which does not have these changes, but only EmployeeDetail2 screen. Below URL will take us there directly.

URL to access: https://sivakumar-bommi.outsystemscloud.com/TestApp/EmployeeDetail2.aspx?EmployeeId=3

Please help.

Hi Siva,

Basically, you're trying to upload a picture before create your employee record. It's not possible.
First, you need an employee record in the database then, can upload a profile picture.


With best regards,
F.Karatay

Hi Karatay,

Please find the latest oml file. 

The flaw is in my design itself - user will not be able to add a profile pic before the employee is saved at least once.

However, the parent page does not refresh on closure of popup after adding a profile pic for an existing employee.

I am very new to Outsystems and not sure what I am missing here. Can you please help?

Regards

Siva

Hi Siva,

On close of popup you need to do explicit refresh of local data and container of parent page, then only latest content will be displayed.

In case if your not sure about page container refresh. Please have look of below url.

https://www.outsystems.com/forums/discussion/35151/popup-close-and-refresh-dataadjax-refresh-on-parent-screen/


Hope this helps.

Sravan

Siva Kumar Bommi wrote:

Hi Karatay,

Please find the latest oml file. 

The flaw is in my design itself - user will not be able to add a profile pic before the employee is saved at least once.

However, the parent page does not refresh on closure of popup after adding a profile pic for an existing employee.

I am very new to Outsystems and not sure what I am missing here. Can you please help?

Regards

Siva

Hi Siva,

I tried your application and it works. Refresh also works.
First I clicked save button because of creating employee record. Then, I open employee detail and upload an image it worked.

With best regards,
F.Karatay

Hi, 

Can't open the app right now. 

But be sure that the image widget filename property has a different value every time you upload a new picture. 

If you use the same file name for all the pictures, the browser will find it in its cache and you will keep seeing the same old image instead of the newly uploaded image. 

Cheers 

Sravan Vanteru wrote:

Hi Siva,

On close of popup you need to do explicit refresh of local data and container of parent page, then only latest content will be displayed.

In case if your not sure about page container refresh. Please have look of below url.

https://www.outsystems.com/forums/discussion/35151/popup-close-and-refresh-dataadjax-refresh-on-parent-screen/


Hope this helps.

Sravan

Hi Sravan,

Thank you for your reply, I have already incorporated "Refresh Data" and "Ajax Refresh" components; these are present in the "OnNotify" screen action - which is being called once the popup is closed using the "Popup_Editor_Notify" screen action.

I have debugged the application and could see that all the web/screen actions are executed but data is not refreshed in the page. Not sure what is missing. Just to make sure that the EmployeeId is not zero, i have a log message in the OnNotify action and it logs correctly.

To the right side is the screen action that is executed when "Save" is clicked on the Popup. And below is the screen action that is called on OnNotify.

Please help.


Ferhat Karatay wrote:

Siva Kumar Bommi wrote:

Hi Karatay,

Please find the latest oml file. 

The flaw is in my design itself - user will not be able to add a profile pic before the employee is saved at least once.

However, the parent page does not refresh on closure of popup after adding a profile pic for an existing employee.

I am very new to Outsystems and not sure what I am missing here. Can you please help?

Regards

Siva

Hi Siva,

I tried your application and it works. Refresh also works.
First I clicked save button because of creating employee record. Then, I open employee detail and upload an image it worked.

With best regards,
F.Karatay

Hi Karatay,

Thank you for your help, I am happy that my app was working for you. Not sure why but it is not working for me. I tried to rebuild and launch the app in new browser but it is still the same. 

However, while debugging I could see that all my code is executed, but just not output observed.

Any input would be very helpful. 

Thank you.

Siva


Solution

Hi Siva,

This is how your image is setup

As you have a FileName with a fixed name (no matter if you change the picture, the file name will be the same), and you set a Cache of 1 week, after the browser downloads the image, no matter you change it, it will not download a new one from the server for at least a week.

To force the browser to download a new image when you change it, the best way is to make the filename "dynamic", so you add a tag for it, for example, that changes every time you change the picture.

Another option is to set off the cache, but this will have a performance penalty, as every time the user opens this screen, the browser will download the image from the server, even if nothing has changed.

Cheers.

Solution

Eduardo Jauch wrote:

Hi Siva,

This is how your image is setup

As you have a FileName with a fixed name (no matter if you change the picture, the file name will be the same), and you set a Cache of 1 week, after the browser downloads the image, no matter you change it, it will not download a new one from the server for at least a week.

To force the browser to download a new image when you change it, the best way is to make the filename "dynamic", so you add a tag for it, for example, that changes every time you change the picture.

Another option is to set off the cache, but this will have a performance penalty, as every time the user opens this screen, the browser will download the image from the server, even if nothing has changed.

Cheers.

Thank you Eduardo, I just realized my blunder. Thank you so much for your inputs. 

But my parent page does not refresh after the pop up is closed, I mean the thumbnail image does not change once a new image is saved and popup is closed.

Would you please help me?

Thank you.


Hi,

This part is because your Notify was placed AFTER the Close.
It must be placed BEFORE it.

Cheers.

Thank you so much Eduardo. This helped me resolve those issues.