On 10/29/2010 01:09 PM, jaronschut wrote:
>
>
> A more generic way to retrieve only the properties from qooxdoo objects is
> to do it like this:
>
>
> var clazz = qx.Class.getByName( this.classname );
> var properties = qx.Class.getProperties( clazz );
>
> var i;
> for (i=0; i<properties.length; i++) {
> this.get( properties[i] );
> ... process the property...
> }
>
> Why there is no standard support for this in qooxdoo beats me. Or I just
> have not found it yet....
If you are referring to a standard properties iterator: To me it feels a
bit contrived to use an external utility to iterate over the properties
of a class, when I'm just writing a method of this class and can access
the properties directly.
But if you really want to do so, e.g. because the class is so big or you
want to decouple the iterator from the actual property definitions,
there is
qx.util.PropertyUtil#getProperties(clazz)
that returns the complete properties map of the class, as passed to
qx.Class.define. E.g. within a class method you could use it as
qx.util.PropertyUtil.getProperties(this.constructor). Mind, though, that
.getProperties also returns properties from class mixins, but leaves out
inherited properties even if they are refined in the given class.
T.
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel