Try using Js.uncheckedCast from jsinterop-base
On Tuesday, February 20, 2018 at 1:59:44 PM UTC-5, Scott Shumway wrote:
>
> I'm still unable to do this. I want to be able to get a DOMRect from a
> com.google.gwt.dom.client.Element with JsInterop. If I cast to this Element
> class, or even
I'm still unable to do this. I want to be able to get a DOMRect from a
com.google.gwt.dom.client.Element with JsInterop. If I cast to this Element
class, or even ((HasGetBoundingClientRect) (Object) element), I will get a
(runtime) java.lang.ClassCastException. The cast to Object works, of
Thanks! I didn't think of casting to Object first... I'll give it a try. I
generally turn on as many compiler warnings as I can stand to get my code
to compile through a strict filter, but I was getting outright errors.
Also, namespace with "Element", Doh! of course...
On Thursday, February
On Thursday, February 15, 2018 at 11:01:41 AM UTC+1, Vassilis Virvilis
wrote:
>
> Amazing trick!
>
> Obvious if you think about it - but very difficult to think it initially
> (for us mere mortals).
>
Well, when you write "element.getBoundingClientRect" in JS (without the
parenthesis), this
Amazing trick!
Obvious if you think about it - but very difficult to think it initially
(for us mere mortals).
Vassilis
On Thu, Feb 15, 2018 at 11:53 AM, Thomas Broyer wrote:
>
>
> On Thursday, February 15, 2018 at 10:21:59 AM UTC+1, Scott Shumway wrote:
>>
>> Greetings
On Thursday, February 15, 2018 at 10:21:59 AM UTC+1, Scott Shumway wrote:
>
> Greetings
>
> I am trying to get a DOMRect from an Element. I can do this with JSNI, but
> have been unable to make a JsInterop version. Here's what I have:
>
> public final class DOMRect extends JavaScriptObject
> {
Greetings
I am trying to get a DOMRect from an Element. I can do this with JSNI, but
have been unable to make a JsInterop version. Here's what I have:
public final class DOMRect extends JavaScriptObject
{
// returns DOMRect or null
public static native DOMRect getBoundingClientRect(Element
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
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
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
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
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
Where do I use $wnd.test.JsOpClass()? It doesn't work within
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
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
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
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;
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.*;
18 matches
Mail list logo