Hello,
I have a strange behavior.
I add 28 textfields. Each textfield has an separate (dynamic) label which
comes from a database.
The label definition come from a remote request.
My code is like this:
----------------------------------------------------------------------------------
var Maincontainer = new qx.ui.container.Composite().set({
alignX: "middle",
alignY: "middle",
width:400,
height : 300
//allowShrinkX: false,
//allowShrinkY: false
});
var layout = new qx.ui.layout.HBox(5);
Maincontainer.setLayout(layout);
Maincontainer.addListener('appear',function(){
var UserID = qx.bom.Cookie.get("C_UserID");
this.JobInfoArr = [];
var req = new qx.io.remote.Request(
"http://localhost/PA/mobilewebjobticket/backend/jobinfo.php",
"GET",
"application/json");
req.addListener("completed", function(e) {
try
{
var content = e.getContent();
if (content == "NOJOBINFO") {
alert(this.tr("No JobInfo
available!"));
}else{
this.JobInfoArr = content;
}//if
}
catch (e)
{
alert("Fehler bei Erhalt des JobStatus: " +
e.toString());
}
}, this);
req.setParameter("UserID", UserID);
req.send();
//LEFT SIDE
var containerLeftVBox = new
qx.ui.container.Composite(new
qx.ui.layout.VBox(5)).set({
//padding : 0,
width: 150,
allowGrowX: true,
allowGrowY: true
});
Maincontainer.add(containerLeftVBox);
//alert(this.__JobInfoArr);
for (var i = 1; i < 15; i++) {
var nameLabel = new
qx.ui.basic.Label(this.JobInfoArr[i]);
containerLeftVBox.add(nameLabel);
var txtJobInfo = new
qx.ui.form.TextField("").set({
maxLength: 15,
//textAlign: "center",
width: 40
//height: 40
});
containerLeftVBox.add(txtJobInfo);
}
Maincontainer.add(new qx.ui.core.Spacer(20, 20));
//Right SIDE
var containerRightVBox = new
qx.ui.container.Composite(new
qx.ui.layout.VBox(5)).set({
//padding : 0,
width: 150,
allowGrowX: true,
allowGrowY: true
});
Maincontainer.add(containerRightVBox);
for (var r = 15; r < 29; r++) {
var nameLabel = new
qx.ui.basic.Label(this.JobInfoArr[r]);
containerRightVBox.add(nameLabel);
var txtJobInfo = new
qx.ui.form.TextField("").set({
// readOnly: true
maxLength: 15,
//textAlign: "center",
width: 40
//height: 40
});
containerRightVBox.add(txtJobInfo);
}
}, this); //Maincontainer.addListener('appear',function()
---------------------------------------------------------------------------------
The strange this is:
If the window opens, all 28 textfields are there but the labels are empty.
If I uncomment the line;
//alert(this.__JobInfoArr);
and run again, then there is an alert "undefined".
BUT, if I then click on ok of the alert message, then all 28 labels are
there.
Could this be a timing problem?
best regards
Hansjoerg
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/Timing-problem-tp6702363p6702363.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel