Hi,
It works like a charm now!
For the event.currentTarget, yes this is true, and I also pointed it in
this thread earlier
https://groups.google.com/forum/#!msg/google-web-toolkit-contributors/QrkNflMKe9E/cyhaHJGwtV8J
. Actually good to know ES6 it won't work lambdas too, which should mean
Ok, JsFunction call/apply issue should be fixed as of
https://gwt-review.googlesource.com/#/c/12810/. Can you verify that for me?
You cannot still access JQuery bound 'this'. However note that the same
issue also exists for ES6 arrow functions.
According to [1] this could be worked around in
1. @JsFunction exported to JS doesn't have apply() and call()
operations. Apply() is used by JQuery (2.1.3) to call callbacks, so
basically it wasn't possible to add handlers using JQuery. See other
thread
on this:
Lambda's are inner classes, so there is always a 'this' bound to the
generated instance, otherwise, the handling method wouldn't be invokable.
Imagine if you were implementing this with JSNI:
class HandlerWithThisImpl implements HandlerWithThis {
public void onEvent(Element target, Event e) {
Hi Ray,
Fully agree with your last statement. For me, definitely more Java than
JavaScript, the whole idea of changing *this* is slightly weird. I get the
Function.bind(), when you pass a function somewhere, but changing this on
caller side seems strange to me.
I don't know how often such
I think this could be handled by @JsConvert that is specific for jQuery
instead of a custom annotation.
On Wed, Apr 29, 2015 at 1:02 AM, 'Ray Cromwell' via GWT Contributors
google-web-toolkit-contributors@googlegroups.com wrote:
Lambda's are inner classes, so there is always a 'this' bound to
1. @JsFunction exported to JS doesn't have apply() and call()
operations. Apply() is used by JQuery (2.1.3) to call callbacks, so
basically it wasn't possible to add handlers using JQuery. See other
thread
on this: