Hi Fabian,
Am 26.01.2007 um 08:09 schrieb Fabian Jakobs:
>> var _this = this;
>>
>> mycall = rpc.callAsync(function(result, ex, id) {
>>
>> if (ex == null)
>> {
>> _this.openWindow();
>>
> In other places of the framework we define an additional parameter for
> 'this' if a callback parameter is required. For example
> "addEventListener" bahaves this way. Wouldn't it make sense to add a
> 'this' parameter to 'callAsync' as well to be more consistent with the
> framework and avoid such hacks?
I don't like the idea of cluttering up callAsync with another
parameter (and I don't consider the use of closures - which is what's
going on here - a "hack").
Besides, there's already the "callAsyncListeners" method which has
the same purpose as "callAsync" but behaves more "qooxdoo-ish" (using
the standard listener concept where you can add a listener with a
specific "this" context).
However, I think the callAsyncListeners method needs some rework (I
don't know who implemented it - Derrell?). I don't see an easy way to
find out which server method was called when the result arrives,
which makes it hard to have concurrent asynchronous calls. I think we
should pass something like {result: ..., methodName: ..., id: ...} to
the listeners.
Regards,
Andreas
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel