JsInterop

173 views
Skip to first unread message

Michael Vogt

unread,
Sep 30, 2014, 6:55:57 AM9/30/14
to Google-Web-Tool...@googlegroups.com
Hello.

Should it be possible right now to use JsInterop to use the facebook
Javascript sdk?

The call I want to use is FB.XFBML.parse

So I created 2 interfaces:

@JsType
public interface FB {
@JsProperty XFBML getXFBML();
}

@JsType
public interface XFBML {
void parse();
}

I get FB through a native function getFB(). When calling
getFB().getXFBML().parse(), the error message is "undefined is not a
function"

Should this work, or am I doing something wrong?


Thanks,
Michael

Michael Vogt

unread,
Sep 30, 2014, 9:05:20 AM9/30/14
to google-web-tool...@googlegroups.com, Google-Web-Tool...@googlegroups.com
Btw, when calling parse() out of jsni or in the browser console, it works fine. So the Javascript side is ok.

Goktug Gokdogan

unread,
Sep 30, 2014, 1:28:51 PM9/30/14
to google-web-toolkit-contributors
Did you enable jsinterop?

If you did, take a look at the generated javascript and see if it makes sense.


--
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 google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAAfA4Fyp3EjVWaHm7OMo3m_LiMZO7ARRDhRaxNpqRy--3_rYfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Arnaud TOURNIER

unread,
Sep 30, 2014, 2:47:31 PM9/30/14
to google-web-tool...@googlegroups.com, Google-Web-Tool...@googlegroups.com
By adding the  -XjsInteropMode JS option, the thing should work.

Michael Vogt

unread,
Oct 1, 2014, 4:39:05 AM10/1/14
to google-web-tool...@googlegroups.com
Thank you for your answers. Yes this was the problem.


Cheers,
Michael

Chris DiGiano

unread,
Oct 1, 2014, 5:37:41 AM10/1/14
to google-web-tool...@googlegroups.com
Have you enabled jsInterop mode via the compiler flag? It looks like this on the command line:
 -XjsInteropMode JS

Chris

On Tue Sep 30 2014 at 7:05:23 AM Michael Vogt <mic...@michaelvogt.eu> wrote:
Btw, when calling parse() out of jsni or in the browser console, it works fine. So the Javascript side is ok.

--
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 google-web-toolkit-co...@googlegroups.com.

John Stalcup

unread,
Oct 1, 2014, 3:03:15 PM10/1/14
to google-web-tool...@googlegroups.com
Make sure turn turn on -XjsInteropMode JS

Daniel Kurka

unread,
Oct 1, 2014, 3:04:26 PM10/1/14
to google-web-tool...@googlegroups.com
Make sure turn turn on -XjsInteropMode JS

-Daniel


For more options, visit https://groups.google.com/d/optout.



--
Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Katherine Stephens
Reply all
Reply to author
Forward
0 new messages