Hi,
I'm using qx.data.controller.Object to control the data binding of several
widgets:
this._model = qx.data.marshal.Json.createModel(modelData);
this._controllerLegend = new qx.data.controller.Object();
this._controllerLegend.addTarget(methodBox, "modelSelection[0]", "method",
true); (selectbox)
this._controllerLegend.addTarget(numClassesBt, "value", "numclasses", true);
(spinner)
this._controllerLegend.addTarget(corSample1, "backgroundColor", "color1",
true); (atom)
this._controllerLegend.addTarget(corSampleN, "backgroundColor", "colorn",
true); (atom)
this._controllerLegend.addTarget(pop1, "value", "color1"); (colorpopup)
this._controllerLegend.addTarget(popN, "value", "colorn"); (colorpopup)
Everything works fine except when I do setModel(modeldata) a strange thing
happens.
If modeldata is like this:
modelData = {"method": 1, "numclasses": 5, "color1": "#FFFDD6", "colorn":
"#FFA500"};
this._model = qx.data.marshal.Json.createModel(modelData);
this._controllerLegend.setModel(this._model);
Works fine!
But if it's like this:
var modelData = {};
modelData.method = 1;
modelData.numclasses = 5;
modelData.color1 = "#FFFDD6";
modelData.colorn = "#FFA500";
this._model = qx.data.marshal.Json.createModel(modelData);
this._controllerLegend.setModel(this._model);
An error arise TypeError: targetIds is undefined!!!
I need to use the second case because I need to build modelData dynamically.
Can anyone help me and explain me why this happen?
Thanks,
Ana Rita Sousa
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/qx-data-controller-Object-setModel-with-strange-behavior-tp7315272p7315272.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