On Wednesday 07 February 2007 00:46, you wrote:
> I think your issue is the use of 'this' inside the eventlistener. At that
> point, 'this' might not refer to what you think it does. I suggest creating
> a variable of 'this' prior to the eventlistener code and use the variable
> inside the function. That should clear up any ambiguity it might have.
I don't think so. 'this' works properly. The issue is that 'text' control
element wasn't generated by time I'm calling it.
Thanks,
Alexei Golovko
>
> On 2/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > On Wednesday 07 February 2007 00:11, you wrote:
> > > var element = document.getElementById(id);
> > >
> > > the above line will not work until the object has been rendered. At the
> > > point you are trying to use it, the object has been created but not
> > > rendered. You need to place the entire for loop into a function that is
> > > called in the layout event 'appear'. This way it does not get called
> >
> > until
> >
> > > the rest of the screen is rendered.
> >
> > Well, I tried your suggestion, it returns valid Element, but now I got
> > another
> > problem. I did this:
> >
> > layout.addEventListener('appear', function() {
> > count = 300;
> > for(var i = 0; i < count; i++) {
> > var id = 'p' + i;
> > this.debug(id);
> > var element = document.getElementById(id);
> > this.debug(i + ' = ' + element);
> > if(element == null) continue;
> > for(var j = 0, list = this.controls[i], len = list.length; j
> > < len; j++) {
> > this.debug('c = ' + list[j].getElement());
> > element.appendChild(list[j].getElement());
> > }
> > }
> > qx.ui.core.Widget.flushGlobalQueues();
> > }, this);
> >
> > And now list[j].getElement() returns null... Actually, is there a way to
> > generate the elemnt of widget inplace? I thought that flushGlobalQueues
> > should help? I even added:
> >
> > qx.ui.core.Widget.addToGlobalWidgetQueue(text);
> > qx.ui.core.Widget.addToGlobalElementQueue(text);
> >
> > But nothing helps.
> >
> > Thanks,
> > Alexei Golovko
> >
> > > On 2/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > > > This should work. But this is really not a thing qooxdoo supports.
> > > > > The element property can be seen as protected - even if not
> > > > > declared as this currently.
> > > >
> > > > Unfortunatelly, this code doesn't work (getElementById always returns
> > > > null).
> > > > Maybe I'm doing something wrong? Could you plz correct me then?
> > > >
> > > > Here is the main method of my application (it is just a brief
> >
> > testing):
> > > > qx.Proto.main = function(e) {
> > > > var layout = new qx.ui.layout.VerticalBoxLayout();
> > > > layout.set({top:0, bottom:0, left:0, right:0, overflow:'scrollY',
> > > > allowStretchY:true});
> > > > layout.addToDocument();
> > > >
> > > > var count = 300;
> > > > var controls = {};
> > > > var html = '<table width="100%" border="1"><th width="0"></th><th
> > > > width="50%"></th><th width="0"></th><th width="50%
> > > > "></th>';
> > > > for(var i = 0; i < count; i++) {
> > > > html += '<tr><td>Label:</td><td><div style="height: 30px;"
> >
> > id="p'
> >
> > > > + i
> > > > + '"></div></td><td>Another Label:</t
> > > > d><td><input></td></tr>' + "\n";
> > > >
> > > > var text = new qx.ui.form.TextField('TextField ' + i);
> > > > text.set({left:0, right:30, top:0});
> > > > text.setStyleProperty('position', 'relative');
> > > > controls[i] = [text];
> > > > }
> > > > html += "</table>";
> > > >
> > > > this.controls = controls;
> > > >
> > > > var embed = new qx.ui.embed.HtmlEmbed(html);
> > > > layout.add(embed);
> > > >
> > > > qx.ui.core.Widget.flushGlobalQueues();
> > > >
> > > >
> > > > for(var i = 0; i < count; i++) {
> > > > var id = 'p' + i;
> > > > this.debug(id);
> > > > var element = document.getElementById(id);
> > > > this.debug(i + ' = ' + element);
> > > > if(element == null) continue;
> > > > for(var j = 0, list = controls[i], len = list.length; j <
> > > > len; j++) {
> > > > element.appendChild(list[j].getElement());
> > > > }
> > > > }
> > > > qx.ui.core.Widget.flushGlobalQueues();
> > > > };
> > > >
> > > > Thanks,
> > > > Alexei Golovko
> >
> > -------------------------------------------------------------------------
> >
> > > > 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
> >
> > -------------------------------------------------------------------------
> > 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
-------------------------------------------------------------------------
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