Brad
Posts: 0
Joined: Wed Dec 07, 2011 4:05 am

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Timer

Yes, custom JavaScript timer is one way to go. Let me find whether possible and/or how to call a service from JavaScript

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Timer

Try this:
setTimeout( "restdatasource01.execute({})" , 5000);

where 'restdatasource01' is the name of the service

Brad
Posts: 0
Joined: Wed Dec 07, 2011 4:05 am

Timer

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Timer

Yes, that's an Ajax status indicator - to let you know that's something is happening. You want to disable it?

Brad
Posts: 0
Joined: Wed Dec 07, 2011 4:05 am

Timer

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Timer

Use this on page load: $('#ajaxBusy').remove();

Brad
Posts: 0
Joined: Wed Dec 07, 2011 4:05 am

Timer

That worked perfectly! Again thanks!

Jonathan Clark
Posts: 0
Joined: Thu Mar 14, 2013 5:25 pm

Timer

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.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Timer

Jonathan, thank you for sharing this.

Return to “Issues”