On Wed, Apr 29, 2015 at 7:53 AM, Marcin Okraszewski <[email protected]>
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 annotation. It only worked when I used
>>> @JsType(prototype="jQuery")
>>>
>>>
> It didn't happen this time. So either
>
>
>>
>>> 1. Couldn't access class with @JsExport annotation from JS.
>>>
>>>
> I had multiple tries of using @JsExport as well as @JsNamespace. This is
> one of them:
>
> public class Hello {
> @JsExport("interop.Hello")
>
JsExport is no longer fully qualified, you need to supply JsNamespace. Try
following:
@JsNameSpace("interop") @JsExport
class Hello {
public Hello() {}
public String sayHello() { .. }
}
Also you need to put @JsType if you want to call sayHello from javascript.
> public Hello() {
> }
> @JsExport
> public String sayHello() {
> return "Hello World!";
> }
> }
>
> JavaScript:
>
> var hello = new interop.Hello();
> alert(hello.sayHello());
>
> Result:
>
> Uncaught ReferenceError: interop is not defined
>
> Marcin
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/7a6094ef-da19-42ff-bf93-3e90a202fe5a%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/7a6094ef-da19-42ff-bf93-3e90a202fe5a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups "GWT
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA0O_XfOhWcnnt3dUs%2Bend%2BoqCs0_Z1n_3N-S2aw6mGYhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.