I've thought a bit about what you ask, and it appears you have two
possibilities with your javascript array of dynamic objects :
a) you want a model, no matter how they're converted. You just want to
display your objects in a list, for instance.
b) you want a model, but you don't want generic objects in it. You have your
custom value object class, and what you need at the end is a qooxdoo array
with instances of this very class.
The answer is simple : a) use a marshaler b) create a qx.data.Array and loop
over your original array to fill it with new instances of your custom class.
An example for b):
var originalArray = [{name: "foo", value:"fooValue"}, {name:"bar", value:
"barValue"}];
var target = new qx.data.Array();
for (var i = 0; i < originalArray.length; i++) {
target.push(new com.pouet.tut.CustomClass(originalArray[i]);
}
This assumes, of course,that in your custom class' constructor, you handle a
generic object from which you read whatever you want. This is just regular
deserialization.
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/How-to-create-my-own-model-I-cannot-find-tp7357709p7358015.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel