Al Veitas
Posts: 0
Joined: Tue Mar 06, 2012 3:43 am

How to Refresh MobileList without refreshing screen?

We have a screen with a mobile list that is populated via a REST service call. Once the page is loaded and mobile list is rendered, is there an "easy" way (or any way) to setup a timer where we could call the rest service and have the mobile list update? Preferably, we could already use what is generated by Tiggzi when the page is loaded (call rest service, load mobile list, etc).

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

How to Refresh MobileList without refreshing screen?

Create new JavaScript file (Project Create New...) and add this code:

code
window.setInterval(function() {
servicename.execute({});
}, 5000);
/code

above service will be invoked every 5 seconds.

I didn't try it on a device but in desktop browser you also would need to call clearInternval() when you navigate to another page as the navigation happens in a frame. If you don't call it, the service would be invoked on every page.

Here is more info:
http://stackoverflow.com/questions/22...
http://www.w3schools.com/jsref/met_wi...

Hope this helps...

Return to “Issues”