On Tue, 12 Oct 2010, nrg-b wrote:
> 1. When I tried to call a member function, myfunc(), in the rpc handler I
> got a "myfunc() is not defined" error message. If I called the member
> function by qualifying as "this.myfunc()" then I get "this.myfunc is not a
> function". I noted that when adding a listener, there is an option to pass
> in 'this' in order to set the function's context. Please can you tell me
> what is the value 'this' in an Rpc handler function? The only way I could
> get round the issue about was to make the function a static one.
I believe 'this' is the context from where the handler is called.
Unfortunately, there is no parameter in rpc.callAsync to pass the context.
You can, however, use qx.lang.Function.bind() to "force" the handler to the
right context:
rpc.callAsync(
qx.lang.Function.bind(this.__yourHandlerDefinedInThisClassFile, this),
'yourRemoteMethod', yourParameters);
Does that help?
Cheers,
Fritz
--
Oetiker+Partner AG tel: +41 62 775 9903 (direct)
Fritz Zaucker +41 62 775 9900 (switch board)
Aarweg 15 +41 79 675 0630 (mobile)
CH-4600 Olten fax: +41 62 775 9905
Schweiz web: www.oetiker.ch
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel