On Mon, May 4, 2009 at 11:41 AM, Michael Ochs <[email protected]> wrote:

> I call the callback() function from rpc.callAsync(this.callback, "method");
>
> What I did before was something like:
> var that = this;
> rpc.callAsync(function(e) { //use that in here }, "method");
>
> But now, because I am using callback() as a real function, I can't work
> with var that = this; because 'that' is out of scope in callback().
>

You should be able to bind 'this' to your callback function like so:

  var boundCallback = qx.lang.Function.bind(callback, this);
  rpc.callAsync(boundCallback, "method");

See the documentation for qx.lang.Function.bind() for additional details.

Derrell
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to