Timer
Is there a way to call a service at specific intervals?
If not, I guess a Javascript timer would be ok to use, but then how to call the service to run?
Thanks..
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Is there a way to call a service at specific intervals?
If not, I guess a Javascript timer would be ok to use, but then how to call the service to run?
Thanks..
Yes, custom JavaScript timer is one way to go. Let me find whether possible and/or how to call a service from JavaScript
Try this:
setTimeout( "restdatasource01.execute({})" , 5000);
where 'restdatasource01' is the name of the service
Max,
Yes, I managed to create a timer from script that works until cancelled. I noticed that when the service runs, the entire screen develops a grey overlay with a busy icon until finished, like it's working without freeing the current thread.
Is there a way to avoid this?
Yes, that's an Ajax status indicator - to let you know that's something is happening. You want to disable it?
Yes, the application I 'm working on needs to run 24/7 in the background, updating at set intervals. The screen would interfere with the other phone/user functions. So, I guess my next question is, how to keep running our applications after exit, in this situation the screen should not turn grey or show Ajax update icon when accessing services.
Use this on page load: $('#ajaxBusy').remove();
That worked perfectly! Again thanks!
I was looking for the same thing and tried this solution, but later found:
var mytimedfunc=setInterval("javascript function",milliseconds);
which automatically runs the event everyXseconds as opposed to once after timeout. I like this a bit better because it's really easy to just add:
clearInterval(mytimedfunc);
on "beforeUnload". Don't know if this is useful to anyone but just thought I would add to the discussion.
Jonathan, thank you for sharing this.