On 4/29/10 3:50 AM, MartinWittemann wrote:
> Hi,
> I took the time today to check that behavior you writing about. This really
> seems like a bug. So I opened up an issue report for that [1].
> Currently, we have a second thread on the mailing list maybe on the same
> issue [2]. Maybe you can have a look at his workaround until the bug is
> fixed.
> Regards,
> Martin
>
> [1] http://bugzilla.qooxdoo.org/show_bug.cgi?id=3650
> [2]
> http://qooxdoo.678.n2.nabble.com/odd-model-behavior-with-qx-ui-tree-TreeFolder-td4921818.html#a4948272
>
Hi Martin and Juan,
Just a quick note: I used the exact code Martin posted to the playground
(using a store bound to the controller as in the bug instead of the
marshalled json) and replaced the createModel() calls with a simple "new
blah.blah.ClassName()" where my classes are hand-constructed models, i.e.:
qx.Class.define("qooxdoo.model.info.Category",
{
extend : qx.core.Object,
properties :
{
id : {
init: null,
nullable: true,
event: "changeId"
},
title : {
init: "New Category",
event: "changeTitle"
},
listorder: {
init: 1,
event: "changeListorder"
},
ispublic: {
init: false,
event: "changeIspublic"
},
entries : {
event: "changeEntries",
apply: "_applyEntries"
},
kids: {
event: "changeKids"
}
},
construct : function()
{
this.base(arguments);
this.setKids(new qx.data.Array());
}
});
so that my button execute listener is:
var button = new qx.ui.form.Button("Add Folder");
button.addListener("execute", function(e){
var n, item = controller.getSelection().getItem(0);
if (item instanceof qooxdoo.model.info.File) {
return; // File is a leaf, can't add folders
} else if (item instanceof qooxdoo.model.info.Entry) {
n = new qooxdoo.model.info.File();
} else if (item instanceof qooxdoo.model.info.Category) {
n = new qooxdoo.model.info.Entry();
} else {
n = new qooxdoo.model.info.Category();
}
item.getKids().push(n);
});
The "Add Folder" button works perfectly with no problem on all levels of
my tree (which I am very excited about). I suspect our bug is somewhere
in createModel() with the on-the-fly classes. I'd love if someone with
more time than me could test out my theory with the smaller models in
the playground to see if that works on another machine.
Thanks,
Greg
P.S. yes, I'm lazy and haven't yet renamed the application from generic
"qooxdoo" generated initially :)
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel