How to refresh a list in mobile after sync completes?

How to refresh a list in mobile after sync completes?

  

In a mobile app, I have a list of items.  Above the list is a "Sync" button that retrieves the latest list of items from the server and updates the locally stored list.  How can I trigger the refresh of the mobile screen's list once the sync finishes in the background?

I tried dropping in an OfflineDataSyncEvents webblock and then setting the OnSyncComplete handler to an action belonging to my screen.  This screen action refreshes the aggregate grabbing the list's data; however, this doesn't trigger the action.


I used this pattern:  https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Offline/Offline_Data_Synchronization_Patterns/Read%2F%2FWrite_Data_Last_Write_Wins


Solution

I found it after downloading the "Offline Data Sync Patterns" sample app from the forge and seeing how it was set up. 

  1. Go to the screen layout by clicking <>.
  2. Click on the Common/Layout web block.
  3. Select the refresh action under Event OnSyncComplete.


Solution