Jim Hunter schrieb:
> It does matter, I think in the context you are calling, 'this' has no 
> context. If you change those lines to :
>
> _this.info(...)   etc. it might work as long as _this is a global var, 
> and the way you initialized it, it's a local var. When you make a call 
> to a function that is not part of an object, there is no 'this' 
> object. 'this' only resides inside an objects code, not code that an 
> object calls unless you pass in a reference to it as a param and then 
> use that reference to make the info calls.
Hi Jim,

no, I  am afraid that this is not the case. If I add a firebug debug 
statement:

[... mixin code ...]  

   handleServerData : function( data )
   {
        // debug to firebug   
      console.log(this);

     this.info("This won't be printed");
     this.warn("Neither will this show up");
     this.error("This will silently end execution");


I will get

qx.ui.treevirtual.TreeVirtual _hashCode=281 __dbKey=201 
_layoutChanges=Object
 ...

in the firebug console.

So "this" always refers to the object to whose prototype the mixins have 
been added. The meaning of "this" doesn't correspond always with the 
execution context of the event handler.

Best,

Christian

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to