27
Views
5
Comments
How to refresh webblock from popup window?

Screenshot 1

Screenshot 2: Popup Window

In the screenshot, timesheets are being submitted by Employee and Manager is Approving the timesheet. After approval from the manager, the timesheet should move to the Approved tab(this is done in a popup window). The problem is that after I click on the Save button in the pop-up window (which gets closed) it should refresh itself in the below table and move to the approved tab but the web block doesn't refresh itself. Instead, it requires a browser refresh. 


Please help resolve this query?

Rank: #272

Hi Mintu,

Is Web Traditional or Reactive?

Rank: #4287

Hi Mintu,

Are you using the popup notify widget in the 'save' action?

You should use the popup notify widget no notify the parent screen that it needs to refresh the data.

You have two ways of doing the refresh:

  • You can just refresh the entire web block and with that, all the queries and logic in the preparation will run refreshing everything
  • You can notify the web block that it needs to refresh the data, using JavaScript, and inside it perform the actions you need

If you are developing in Outsystems 11 you should considerer changing your logic to a Modal since you don't need the notify and your save action can do the refresh without needing to do a notify.

If the application is done in reactive just add or remove/add the record from the list and screen will update automatically.

Hope it helps.

Best regards,

Ricardo Pisco.

Rank: #4287

Hi Mintu,

The first part is dedicated to web traditional:

You should use the popup notify widget no notify the parent screen that it needs to refresh the data.

You have two ways of doing the refresh:

  • You can just refresh the entire web block and with that, all the queries and logic in the preparation will run refreshing everything
  • You can notify the web block that it needs to refresh the data, using JavaScript, and inside it perform the actions you need

If you are developing in Outsystems 11 you should considerer changing your logic to a Modal since you don't need the notify and your save action can do the refresh without needing to do a notify.

The reason I've mentioned the modal is just that modal is a lot easier to use.


For your case and to use what your comfortable with just refresh the entire web block and with that, all the queries and logic in the web block preparation will run refreshing everything.

 

You can find the Popup_Editor_Notify is a widget from RichWidgets and with this, the action you selected when adding the Popup_Editor screen widget will trigger.

Hope it helps.


Best regards,

Ricardo Pisco.