471
Views
7
Comments
Solved
Mobile Screen Refresh On Timer
Question

I need to refresh my screen on mobile every 5 second , i am doing it the same way we did it in web but it just working once , i want to work it as timer which runs every 5 second.




Regards

-PJ-

Solution

Hi Pramod,

Do the following:

1) create a Javascript Node with one integer output param;

2) place the following code: $parameters.TimerHandle = setInterval($actions.MyAction, 5000);

3) store the TimerHandle in a local variable of the screen to use it later

4) in the On Destroy event of the screen place another Javascript Node with one input integer param

5) insert there the following code: clearInterval($parameters.TimerHandle);

João Neves wrote:

Hi Pramod,

Do the following:

1) create a Javascript Node with one integer output param;

2) place the following code: $parameters.TimerHandle = setInterval($actions.MyAction, 5000);

3) store the TimerHandle in a local variable of the screen to use it later

4) in the On Destroy event of the screen place another Javascript Node with one input integer param

5) insert there the following code: clearInterval($parameters.TimerHandle);

This works perfectly. But there is only one detail, the correct syntax for instantiating the javascript is (step 2):


$parameters.TimerHandle = setInterval(function(){ $actions.MyAction() }, 5000);


Thanks João!




Thank you! your post helped me a lot to solve an error that was bothering me for a long time. Thank you very much!!
mvp_badge
MVP

Thanks for the quick response ..Can you please share example oml .



Regards

-PJ-

Sorry, I didn't make any oml. Currently away from my computer.

mvp_badge
MVP

Ok np , can you let me know how could i create a javascript node?




There's a yellow icon on the left toolbar named Javascript Node when you're editing client-side actions. Drop one into the flow. :)

Check out the documentation for more help:

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/JavaScript


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