Howdy! If you want that kind of change to be rendered immediately (not triggered by the next mouse move for example), you have to manually force an update: qx.ui.core.Widget.flushGlobalQueues();
For more information, please see http://qooxdoo.org/documentation/snippets/forcing_an_update Bye, Andreas Ciprian Onofreiciuc wrote: > Hello, > I have a problem with refreshing a label. > having a label that I want to change its content after a click event > combined with a setTimeout function, like in the code bellow: > > qx.core.Init.getInstance().defineMain(function() > { > var d = qx.ui.core.ClientDocument.getInstance(); > > function handler1(e){ > setTimeout(changeText1,1000); > } > function changeText1(){ > label1.setHtml("hello world"); > } > > function handler2(e){ > setTimeout(changeText2,1000); > } > function changeText2(){ > document.getElementById("label2").innerHTML = > "good refresh: hello > world!"; > } > > label1 = new qx.ui.basic.Label("hello"); > //good label > label2 = new qx.ui.basic.Label("good refresh: > hello"); > > label2.setHtmlAttribute("id","label2"); > > label1.addEventListener("click",handler1); > label2.addEventListener("click",handler2); > > with(label1){ > set({ left:5, top:5, right:5, bottom:5 }); > } > with(label2){ > set({ left:5, top:25, right:5, bottom:5 }); > } > > > d.add(label1); > d.add(label2); > }); > > I encountered the difficulty to change the text of the label. It doesn't > refresh in the window, immediately after settimeout execution, but after > another event happens, like moving the mouse or pressing a key. > Try to click on the first label, and don't move the mouse for more than 1 > second. The text won't change. > > With the second label, I changed the content using getElementById and > innerHTML and it works immediately, after the timmeout exprires. > > Can anyone explain to me why it doesn't work with setHtml function from the > qx.ui.basic.Label? > > Thanks, > Ciprian ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
