Tuesday, October 11, 2016

Re: jsinterop @JsFunction: How to get this (context)?

That's the opposite problem (also present in D3 though) where you have a js callback and you want to map it to a java functoid.

The problem at hand is about mapping a java functoid.to a js callback (done via @JsFunction) and also get access to the already bound __this__ variable.

So my implementation based on a suggestion from Stepan Koltsov was to wrap the native js callback. I understand that it used JSNI and JavaScriptObject that are destined to deprecation but I didn't see any other way.

Of course it would be great if you come with a better approach...

    Vassilis


On Tue, Oct 11, 2016 at 4:03 PM, Paul Stockley <pstockley1@gmail.com> wrote:
It should be possible to write a helper that uses the javascript bind command so that you can bind this for any functional interface. I will have a play and see if I can get something working.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.



--
Vassilis Virvilis

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment