Hi Marius,
that's sounds really strange. It seems to me that the instances are
disposed when your "update" listener/handler is executed. Could you
please check this by:
snProxy.addListener("update", function() {
this.debug(this);
this.debug(this.isDisposed());
this.debug(this.__rootNode.isDisposed());
this.debug(this.__rootNode.getChildren());
this.refreshTree();
}, this);
Cheers,
Chris
Am 22.09.2010 14:17, schrieb marius123:
> Hi all,
> I have a strange problem. Have a look at this code:
>
> __applyDataModel: function(dataModel) {
> this.debug(this);
> this.debug(this.__rootNode);
> this.debug(this.__rootNode.getChildren());
>
> // Do some stuff...
>
> // Then update
> snProxy.addListener("update", function() {
> this.debug(this);
> this.debug(this.__rootNode);
> this.debug(this.__rootNode.getChildren());
> this.refreshTree();
> }, this);
> }
>
> This is an apply-method in a class called tt.ui.module.tree.Tree.
> The code here simply prints the name of the class and the content of the
> class variable __rootNode to the console. First directly in the method, and
> a second time after the "update"-event handler function is called. This is
> the output:
>
> 019406 tt.ui.module.tree.Tree[648]: Tree[648]
> 019408 tt.ui.module.tree.Tree[648]: TreeFolder[915]
> 019409 tt.ui.module.tree.Tree[648]: [ ]
>
> 019771 Tree[undefined]
> 019773 TreeFolder[undefined]
> 019774 null
>
> As you can see, the hash codes are now undefined. The class variable still
> contains the qx.ui.tree.TreeFolder object but now the getChildren-method
> doesn't return an empty array but null.
>
> What can have happened to the Tree object here? In my application I can't
> figure out any reason for this. As far as I can see nothing concerning the
> Tree object is changed in between the output of the two debug blocks.
>
> Just in case this might help: The Tree object is initially created in a way
> like this:
> var M = qx.Class.getByName(modules[j].type);
> var m = new M();
>
> Cheers
> Marius
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel