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
On Wed, Apr 29, 2015 at 7:53 AM, Marcin Okraszewski okr...@gmail.com
wrote:
Hi Goktung,
I've compiled the latest version from trunk and rechecked those items you
wanted the snippets for.
1. I wasn't able to call methods on jQuery object returned from JSNI
when using just @JsType
Hi Goktung,
I've compiled the latest version from trunk and rechecked those items you
wanted the snippets for.
1. I wasn't able to call methods on jQuery object returned from JSNI
when using just @JsType annotation. It only worked when I used
@JsType(prototype=jQuery)
It didn't