Hi, I'm using data binding in my apllication. I used the qx.data.store.Json class to fetch a PHP script that outputs JSON encoded data. The data are correctly gotten, infact I can use it with success. Further I can see with the debugger that it creates a class in qx.data.model. Since the structure of the data is made of:
-id field (a number) -text (string) -time (float) the class that gets created is qx.data.model.id"text"time, written exatly in this way (I don't know if " is one double quote or two single quote) because both the debug method and firebug DOM inspector write it in this way, so I think it's the name qooxdoo gave to that class. Now, I have a qx.data.Array of objects of that class (as a property of the model property of the JSON store), how can I do if I want do add a new object of that type tho the array? How can I create an instance of qx.data.model.id"text"time from code? First, it's tennically possible? If yes, how can I do? Because, obviously, writing var o = new qx.data.model.id"text"time(); gives me error caused by quotes, also escaping them with \. I saw in the documentation that the data binding mechanism use this piece of code to internally set property changes: targetObject["set" + qx.lang.String.firstUp(targetProperty)](data); I have to use something similar? I tried something similar but doesn't work, I don't know how to write it. I read somewhere about using qx.data.marshal.Json.createModel, but I tried this and seems like that the models created with it and ones with JSON store are not EXATLY made of the same internal structure, because the sort() method of Array works bad (it doesn't sort all elements, exatly when in the array are present both JSON store created models and json marshal created models). -- View this message in context: http://qooxdoo.678.n2.nabble.com/how-to-use-dinamically-created-class-tp6299292p6299292.html Sent from the qooxdoo mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
