Hi everyone
I'm just evaluating qooxdoo as js framework for a pretty large project and the
most troubles I'm finding is about data access and binding. And, if I am really
making progress, sometimes I find some weird (for me as I dont understand why)
behaviors.
It is this case. I just have the following piece of code:
/*
*****************************************************************************
*/
var names = ["Max", "Jackob", "Tim", "Jack", "Dan", "Dustin", "Karl",
"Jim"];
var emotes = ["embarrassed", "kiss", "plain", "sad", "surprise", "angel"];
// create the data
var rawData = [];
for (var i = 0; i < 20; i++) {
var person = {};
person.name = names[i % names.length];
person.emote = emotes[i % emotes.length];
person.online = (i % 3 == 0);
rawData.push(person);
}
// this converts (in this particular case)
// a js array into a qooxdoo array
var peopleData = qx.data.marshal.Json.createModel(rawData);
/*
*****************************************************************************
*/
var displayPane = new qx.ui.container.Composite(new qx.ui.layout.VBox(5))
displayPane.set({height:250, width:350})
displayPane.setBackgroundColor("yellow")
var listData = new qx.ui.form.List()
var ctrlList = new qx.data.controller.List(peopleData,listData)
ctrlList.setLabelPath("name")
// peopleData.bind("name", listData, "label")
displayPane.add(listData)
this.getRoot().add(displayPane, {top: 50, left:100})
If I run this one, I get an error.
If I set the labelPath in the controller constructor as
var ctrlList = new qx.data.controller.List(peopleData,listData, "name")
it works ok, the list is filled with names. I suppossed the labelPath could be
null in the constructor then set it through setLabelPath(...) method. Is this
incorrect? what is the rule or the best practice for that? using delegates most
of the time maybe? does anybody know what?
Cheers in advance
w i l l y
--
Guillermo C. Martínez
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel