Hi Sak,

thanks lot for help.

I did it now in this way and it works.

by the way:

Later a user can fill in all 28 textfields and after that I want to store
these values in a database.
In the database each textfield has an own columnname.

What I am missing is an attribute name=MyTextfield1 or an unique identifier
for each textfield.

Is there nothing like an "name" attribute?

best regards
Hansjoerg


2011/8/19 Mustafa Sak <[email protected]>

> Hi,
>
> Just try to put creating label and textfield code in a separate function
> and run this function at complete listener. Because a listener is often
> firing after his embedded function.
>
> Regards Sak
>
> Von meinem iPhone gesendet
>
> Am 19.08.2011 um 10:42 schrieb hjschock <[email protected]>:
>
> > 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
>
>
> ------------------------------------------------------------------------------
> 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
>
------------------------------------------------------------------------------
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

Reply via email to