On Mon, Apr 6, 2009 at 11:29 AM, Stefan Volbers <[email protected]> wrote:
> Hi Gene,
>
> I do something similar in a standard qx application, populating several
> form elements with rpc result data.
> Works for me with any browser I could test, and actually is working fine
> at my customer's place.
>
> I believe the problem is that you use for ( in ) on the rpc result with
> IE6. This has been discussed here before, but I can't find it right now.
> Qooxdoo, for reasons not on my radar right now, extends the for/in, but
> that doesn't work properly on some data types (I believe it somewhat
> fails on objects, but is clean on numerical arrays; the effect is that
> some property data or even methods get iterated; as a result i usually
> had three empty elements in a select box).
>
for/in works fine for objects, which is what it's intended for. If you use
for/in on arrays, Firefox iterates over only the members values of the
object while IE iterates over both the members and any functions which have
been added to the prototype of Array. For historical reasons (which are
being remedied currently with the qx.base.Array classes), qooxdoo added
methods to Array's prototype to make Array instances provide the same member
functions in all of the various browsers. (This is contrary to the published
claims of qooxdoo that it does not extend native types, which I expect is
why the current work to remedy that is ongoing.)
There's really no reason to use for/in on arrays anyway. Although
non-integer indexes work on arrays, that's really just adding object
properties, not technically adding array members. It's as easy to use
for (var i = 0; i < arr.length; i++)
as
for (var name in arr)
and is more reliable.
Derrell
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel