Date or ajax loop

Develop and Deploy Cross-Browser Web Apps .

Date or ajax loop

Postby kevinotton » Sun Feb 08, 2015 2:50 pm

I need to have a loop that can update the date displayed and /or check a database field to see if a screen refresh is required.

Can anyone advise on the best controlled way to do this.

Thanks
Kevin
kevinotton
 
Posts: 39
Joined: Thu May 15, 2014 8:18 am
Location: Needham Market, Suffolk, UK

Re: Date or ajax loop

Postby support » Mon Feb 09, 2015 1:19 am

You can try xui.Timer control or use xui.Thread.repeat function.
support
 
Posts: 352
Joined: Sat Apr 27, 2013 9:22 am

Re: Date or ajax loop

Postby kevinotton » Mon Feb 09, 2015 10:57 am

Are there any examples that use this?
kevinotton
 
Posts: 39
Joined: Thu May 15, 2014 8:18 am
Location: Needham Market, Suffolk, UK

Re: Date or ajax loop

Postby support » Tue Feb 10, 2015 3:01 am

   
Class('App', 'xui.Com',{
Instance:{
iniComponents : function(){
// [[Code created by CrossUI RAD Studio
var host=this, children=[], append=function(child){children.push(child.get(0));};

append(
(new xui.UI.Input())
.setHost(host,"ctl_input1")
.setDirtyMark(false)
.setLeft(60)
.setTop(20)
.setWidth(240)
.setLabelSize(120)
.setLabelCaption("Timer Tigger")
);

append(
(new xui.Timer())
.setHost(host,"ctl_timer1")
.setInterval(500)
.onTime("_ctl_timer1_ontime")
);

return children;
// ]]Code created by CrossUI RAD Studio
},
_timerCount:0,
events:{
"onReady" : "_com_onready"
},
_com_onready:function (com, threadid){
var ns = this;
xui.Thread.repeat(function(){
ns.ctl_input1.setValue((ns._timerCount++) + "");
},1000);
}
}
});
   
support
 
Posts: 352
Joined: Sat Apr 27, 2013 9:22 am


Return to CrossUI for Web Apps

Who is online

Users browsing this forum: No registered users and 0 guests

cron