And i want to programmatically open/close item
I'm trying do it such way:
this.treeController.getSelection().getItem(0).setOpen() but this method does nothing.
Also method this.treeController.getSelection().getItem(0).getOpen() returns "false" result for even item state (opened or closed). Why?
I think Item1 and tree.getRoot().getChildren() are not reference to the same folder widget.
I think the controller "reinterpret" treeData like a model, and build other nodes. But I am not sure about this conclusion...
(sorry the english!)
I'm note really surprised that it does not work after taking a look at your code. Let me explain why:
You are mixing things up here a bit. The nodes you store in your treeData array are customTreeNode's. You pass these custom tree nodes to the controller as model. So the controller takes the data (and only the data) out of these objects and thats it. It is not using these objects as TreeFolders in the tree (visually) because it creates new widgets. It doesn't know that it should use these objects.
gets you the TreeFolder shown visually which then is opened as expected.
So subclassing the TreeFolder with your model is not really necessary. Subclassing qx.core.Object should be enough.