557
Views
2
Comments
How can i implement auto refresh on container in Mobile application?
Discussion

Hello Team,

I am new to Outsystem development. I am developing a mobile application. I want to refresh a container or a block automatically for every n seconds. 

Regards

Nitesh Pandey


2020-02-28 09-46-54
Eduardo Jauch

Hello Nitesh,

In mobile, you update data and the UI widgets using this data will be automatically refreshed.

As for updating data every x seconds, I assume you can run a JavaScript that runs an action every X seconds and this action updates your data source (an aggregate for example).

Cheers

2025-01-07 17-06-54
Paulo Cação
Champion

Hello Nitesh,

The Outsystems Mobile use Reactjs, and you can update data and widgets automatically without Ajaxrefresh, as  @Eduardo said above.

You can try something like this:

- In your screen, add a new action in your On render (read here about lifecycle screen)

- Add a JavaScript in the flow, in the new action created above

- Add some like this:

setTimeout(function() {
   $actions.YourActionToRefreshData()
   console.log("Test refresh data");
}, 3000);

I think this is what you want. Read more about setTimeout() here.

Just a note: you need to pay attention to the number of requests sent to the server, can cause performance problems.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.