800
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-

2016-11-20 11-27-52
João Neves
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);

2018-04-02 19-18-18
Marco Filho

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!




2023-05-26 12-40-05
Ythalo Dutra
Thank you! your post helped me a lot to solve an error that was bothering me for a long time. Thank you very much!!
2025-08-22 10-19-44
Pramod Jain
 
MVP

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



Regards

-PJ-

2016-11-20 11-27-52
João Neves

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

2025-08-22 10-19-44
Pramod Jain
 
MVP

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




2016-11-20 11-27-52
João Neves

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.