Hi Tobias,
You can your qx.lang.Function.bind
server.callAsync(qx.lang.Function.bind(handler, this), arg1, arg2...);
That should fix your issue :)
HTH
Matt
Tobias Oetiker wrote:
> While qooxdoo is hurling towards 1.0 there is this question that is
> bugging me.
>
> I have learned, that using anonymous functions leads to grief when
> debugging. So instead of
>
> server.callAsync(function(ret,exc,id){
> \\ handler code
> },arg1,arg2,arg3);
>
> I am writing
>
> function handler(ret,exc,id){
> \\ handler code
> }
>
> server.callAsync(handler,arg1,arg2,arg3);
>
> unfortunately handler runs out of scope. I can therefore not
> access 'this' inside the handler. Unless I pass this into the
> handler with the var that=this trick.
>
> It works fine but it makes it impossible (afaik) to setup handlers
> as private methods in the object.
>
> In other methods like addListener it is possible to pass along the
> scope the handler should be run in.
>
> I would realy like to see a callAsyncScoped call that works similar
> to addListener:
>
> callAsyncScoped(handler,scope,arg1,arg2,....)
>
> cheers
> tobi
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel