Hey,
yes but thats a most common question we have with the data array and I finaly 
came up with an idea how to avoid this question. I just put in a piece of code 
which make the printout contain some directions instead of an empty array:
https://github.com/qooxdoo/qooxdoo/commit/14c17cbd4e4adae2875a5fde5b28f86cb5813793
I guess that might have helped as well. :)
Regards,
Martin

Am 13.11.2011 um 23:18 schrieb <[email protected]<mailto:[email protected]>> 
<[email protected]<mailto:[email protected]>>:

Thak you Martin. This is the point that I was missing.
Regards




----- Original Message -----
From: Martin Wittemann
Sent: 11/09/11 01:48 AM
To: qooxdoo Development
Subject: Re: [qooxdoo-devel] Problem in creating master/child qx.core.Model

Hey,
the marshaling always creates a data array which is an object which has the 
length property but you can not access the items with the default brackets 
notation. You have to use getItem(i) to access each item. Unfortunatelly, the 
browsers console's do not know that but think its an default array because of 
the length property and therefore show the undefined values. You can use the 
toArray method for debugging the array on the console e.g.
http://tinyurl.com/cqfdl9w
Was that your problem?
Regards,
Martin

Am 08.11.2011 um 20:19 schrieb Andria Jones:

Hello Qooxdoo gurus,

Can somebody help me what I am doing wrong in marshalling json object?

Here is my code:

    var skelton = {
        "id":77,
        "customerId":3,
        "items":[
           {
             "itemId":43,
             "productId":2,
              "product":{
                 "id":2,
                 "name":"Product 2"
              },
              "packname":"Box",
              "packing":{
                 "packname":"Box"
              },
              "quantity":15,
              "price":25
           },
           {
             "itemId":44,
             "productId":1,
              "product":{
                 "id":1,
                 "name":"Product 1",
              },
              "packname":"Box",
              "packing":{
                 "packname":"Box"
              },
              "quantity":10,
              "price":20
           }
        ],
        "customer":{
           "id":3,
           "name":"Customer 333333"
        },
        "invDate":"2005-06-07"
     };
     var model = qx.data.marshal.Json.createModel(skelton);
     alert(model.getItems());

but model.getItems() is returing an array of two undefined objects instead of 
item objects.

Thanks in advance for your support.

Andria 
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
qooxdoo-devel mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to