Howdy!

On Fri, 2010-08-27 at 16:03 +0200, Claus Straube wrote:
> Hi all,
> 
> if some problems with array handling inside qooxdoo. This is my code
> (testet in playground):
> 
> --snip--
> var skeleton = {foo: "foo", bar: "bar", foobar: [{ x: "x1", y: "y1" },
> { x: "x2", y: "y2" }]};
> var model = qx.data.marshal.Json.createModel(skeleton, true);
>       
> var foobar = model.getFoobar();
>       
> this.debug("first item of foobar --> " + foobar.getItem(0));
> this.debug("first item of foobar --> " + foobar[0]);
> --snip--
> 
> the debug out put is:
> 602297 playground.Application[456]: Starte Anwendung 'Eigener Code
> (geƤndert)' ... 
> 602302 playground.Application[456]: Anwendung gestartet. 
> 602309 demobrowser.demo.ui.MultiPageForm[761]: first item of foobar -->
> qx.data.model.x"y[743] 
> 602313 demobrowser.demo.ui.MultiPageForm[761]: first item of foobar -->
> undefined 
> 
> Why is foobar[0] undefined? It's an array, or not? So I should be able
> to reach the value with "standard" array functionality. How can I get my
> model working with [x]? Thanks in advance.

No, in data binding it's not a native JS array, it's of type
qx.data.Array. All native methods and even the "length" property are
wrapped, but accessing items via brackets is not (and unfortunately
cannot be) supported.

TTYL,

Andreas



------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to