Re: Trouble understanding JsInterop

2017-04-12 Thread Thomas Broyer
On Wednesday, April 12, 2017 at 9:01:37 AM UTC+2, DavidN wrote: > > There is one thing people keep on repeating: > You can only invoke the exported class/method when the gwt app is loaded. > Just like with any asynchronously loading script. For example, the Google Analytics snippet

Re: Trouble understanding JsInterop

2017-04-12 Thread Philipp
The JsInterop part worked now - in the end it was the missing -generateJsInteropExports and my confusion when to use $wnd and when not. On Tuesday, 11 April 2017 17:30:39 UTC+2, Thomas Broyer wrote: > > > > On Tuesday, April 11, 2017 at 4:53:24 PM UTC+2, Philipp Gloor wrote: >> >> Where do I use

Re: Trouble understanding JsInterop

2017-04-12 Thread David
There is one thing people keep on repeating: You can only invoke the exported class/method when the gwt app is loaded. Is there a GWT supported default way that would allow this ? Otherwise I guess you would need to add a callback mechanism in the EntryPoint (Using JsInterop) On Tue, 11 Apr

Re: Trouble understanding JsInterop

2017-04-11 Thread Thomas Broyer
On Tuesday, April 11, 2017 at 4:53:24 PM UTC+2, Philipp Gloor wrote: > > Where do I use $wnd.test.JsOpClass()? It doesn't work within

Re: Trouble understanding JsInterop

2017-04-11 Thread Vassilis Virvilis
It should work but you also have to make sure that GWT code is loaded. So after the crash - hit F12 go to console and try to reference $wnd.test.JsOpClass or put a console print inside onModuleLoad to see when GWT code is loaded: before or after the crash Vassilis On Tue, Apr 11, 2017 at 5:52

Re: Trouble understanding JsInterop

2017-04-11 Thread Philipp Gloor
Where do I use $wnd.test.JsOpClass()? It doesn't work within

Re: Trouble understanding JsInterop

2017-04-11 Thread Vassilis Virvilis
Hi, 1. With jsinterop you won't need any JSNI normally. 2. If you have older JSNI code that calls your new code (can't really happen) you can a) use new $wnd.test.JsOpClass(); with -generateJsInteropExports as Thomas suggested b) use the old syntax found here

Re: Trouble understanding JsInterop

2017-04-11 Thread Philipp Gloor
NB: I changed the namespace from test to pdf -> that's why it is now $wnd.pdf is undefined. On 11 April 2017 at 16:29, Philipp Gloor wrote: > Can I access Classes and Methods decorated with JsType/JsMethod from > anywhere within GWT granted I'm inside a JSNI block? Or

Re: Trouble understanding JsInterop

2017-04-11 Thread Philipp Gloor
Can I access Classes and Methods decorated with JsType/JsMethod from anywhere within GWT granted I'm inside a JSNI block? Or is it restricted to packages? I added the -generateJsInteropExports to the run configuration arguments but when I try to create a new object JsOpClass() it tells me

Re: Trouble understanding JsInterop

2017-04-11 Thread Thomas Broyer
On Tuesday, April 11, 2017 at 10:43:06 AM UTC+2, Philipp wrote: > > If I have a java class and I mark it with @JsType I create a contract > between Java and Javascript that I can use this class with it's given Java > name in Javascript - is this correct? > > package com.test.workertest.shared;

Trouble understanding JsInterop

2017-04-11 Thread Philipp
If I have a java class and I mark it with @JsType I create a contract between Java and Javascript that I can use this class with it's given Java name in Javascript - is this correct? package com.test.workertest.shared; import com.google.gwt.core.shared.GWT; import jsinterop.annotations.*;