Setting the progressbar value in a mobile app 

Setting the progressbar value in a mobile app 

  

Hi,

I'm working on the version 10 platform and enjoying it highly, but now stumbled upon a small problem. I have a screen in my mobile app where I synchronize some data, i like to show the progression to the user using a progress bar, but from code there is no way I can change the value of the progresssbar. Anuone has an idea hw to accomplish this ? 

regards,

Wim

Hi Wim,

Can you share an image or oml of your logic, so that I can help you with the best approach?

João Neves wrote:

Hi Wim,

Can you

 share an image or oml of your logic, so that I can help you with the best approach?

This is the screen, the loading boilers text is on the prgress bar

When pressing the button Start sync, i start connecting to the server to get my boilers and other stuff into the local client storage

I get the boilerlist using a rest call then load it to my local storage. In the assign I want to set the value of the progressbar to indicate how far the loading process is

First you have to create a local variable on your screen to store the progress. Then you have increment that variable's value as the progress of sync moves forward (on that assign). The trick here is to update the UI while this logic is running. To do that you will have to use a Javascript node with the following code:

$public.View.render($resolve);

But be careful and don't execute this JS Node very often as it will have significant performance impact and slow down the whole operation. I suggest that you do this once in a while (for instance for every 30 iterations or more - you'll have to tweak this).

For more information about this $public JS API check out here:

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/View

Have in mind that this is only available in platform version 10.0.200 or above.

It's back to the old days of windows programming ;-) fiddeling around with some java script isn't very nice but ok should be do-able, thx for the sollution, will try this out.

Solution

It turns out its sufficient to just link a screen variable to the progressbar, and updating this variable in the load process automatically will result in the progressbar moving without any java code

Solution

It might work but its guaranteed that the progress will be updated (rendered).