[gwt-contrib] Re: Experience with JsInterop status

2015-04-29 Thread Marcin Okraszewski
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:

Re: [gwt-contrib] Re: Experience with JsInterop status

2015-04-29 Thread 'Ray Cromwell' via GWT Contributors
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) {

Re: [gwt-contrib] Re: Experience with JsInterop status

2015-04-29 Thread Marcin Okraszewski
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

Re: [gwt-contrib] Re: Experience with JsInterop status

2015-04-29 Thread 'Goktug Gokdogan' via GWT Contributors
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

Re: [gwt-contrib] Experience with JsInterop status

2015-04-29 Thread 'Goktug Gokdogan' via GWT Contributors
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

Re: [gwt-contrib] Experience with JsInterop status

2015-04-29 Thread Marcin Okraszewski
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