Hi,
the answer is that you have to initialize your property on instance level
using the "initFields" method (in your case) in your constructor. This way the
property in *not* shared between the instances.
See
http://qooxdoo.org/documentation/0.8/defining_properties#defining_an_init_value
for details. The important sentence in the docs is
"Using an initializing function this.initProperty(value) in the constructor
would allow you to assign complex non-primitive types (so-called “reference
types” like Array, Object) that should not be shared among instances, but be
unique on instance level."
cheers,
Alex
On Wednesday 15 April 2009 A.Yerenkow wrote:
> Hello Guys, would someone explain me one thing:
>
> Is properties static? because it seems so for me.
>
> Here I have class definition:
>
> qx.Class.define("my.vo.TestVO",
> {
> extend : qx.core.Object,
> properties :
> {
> fields : {init: new Array()}
> }
> });
>
> Here I have test case:
>
>
> var o = new my.vo.TestVO();
> var f = o.getFields();
> alert(f.length); /// alert 0, as must be in normal world
> f[f.length] = "";
> f[f.length] = "";
>
> o = new my.vo.TestVO();
> f = o.getFields();
> alert(f.length); /// alert 2 ?????
>
>
> I'm using 0.8.2, currently I'm developing with "python generate.py source".
------------------------------------------------------------------------------
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