Hello,

i see the problem. Its not the setting of the value, its the reading. The properties can not be accessed by just adding its name after the this.

this.fonts

does not work because the property is not stored there. You have to use the getter to access the property.

this.debug(this.getFonts());

should work for you.

Best,
Martin


Am 13.05.2009 um 19:05 schrieb Jean-Noël Rivasseau:

Hi Martin,

Thanks for the reply - this did not work though. So here is my code:

    properties:
    {
fonts: {"init": null, "event": "changeFonts", "check": "qx.data.Array", "apply": "_applyGeneric"}
    },

    construct: function()
    {
        this.base(arguments);
        this.setFonts(new qx.data.Array(]"ara", "bibi"]));
        this.debug(this.fonts);
    },

I understood why it should not be in the init part, since it will result in an Array instance shared by all the instances. However using the setter in the constructor does not work: I still get undefined on the next line.

Also, why initFonts() should not be used in this case, can you explain ?

Jean-Noel


On Wed, May 13, 2009 at 2:18 PM, Martin Wittemann <[email protected] > wrote:
Hello Jean-Noel,

you have to use a mix of attempt one and three.

First you have to define the property itself. Therefore you have to
add the property name to the properties definition like you did in
point 1. The only thing you should not do is to add the array as the
init value. This code will only be run once while defining the class
so the defined array will be the same for every instance of the class.
So you better initialize the property with null.
You should additionally define a event for that property. this event
is important to get the data binding working. Take a look at the
following code to see how it could look:

myProperty : {
  check : "qx.data.Array",
  init : null,
  event : "changeMyProperty"
}

Now you have set up the property. To initialize it, you should use the
code mentioned in point three.
Use the setter of the property and set the desired initial value.

this.setMyProperty(new qx.data.Array("a", "b"));

After that, everything is prepared for the data binding. :)

Best,
Martin


Am 13.05.2009 um 11:46 schrieb Jean-Noël Rivasseau:

> Hello,
>
> today I tried to define a qx.data.Array property on one of my class
> (to use data binding with a List on it). I could not manage to
> understand how to properly initialize this property to make it work.
>
> I tried several things:
>
> 1) Defining the property as: myProperty: { init: new
> qx.data.Array(["hello"]), check: "qx.data.Array" } (I am not
> surprised this one did not work)
>
> 2) Calling this.initMyProperty(new qx.data.Array(["hello"]) when in
> the constructor. Also used deferredInit on the property
> configuration, but did not help.
>
> 3) Calling this.setMyProperty(new qx.data.Array(["hello"]) when in
> the constructor.
>
> In any case, my property is always undefined. It works if I do
> directly in the constructor:
>
>         this.fonts = new qx.data.Array(["ara", "bibi"]);
>
> but in this case I am bypassing the whole purpose of init, right?
>
> How should I do it properly ?
>
> Thanks
>
> Jean-Noel
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances!
> Your
> production scanning environment may not be a perfect world - but
> thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW
> KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. 
http://p.sf.net/sfu/kodak-com_______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



--
Jean-Noël Rivasseau
Shoopz - Lead Developer / Responsable Développement
http://www.shoopz.com/
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. 
http://p.sf.net/sfu/kodak-com_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to