Questions tagged [gwt-jsinterop]
39 questions
1
vote
0 answers
GWT - using compiled code (JsInterop) in a service worker
I am trying to use JsInterop to call compiled gwt code from a service worker. I am just trying to do a test using a tutorial class:
@JsType(name = "TestJsInterop", namespace = "evc")
public class TestJsInterop {
public boolean bool = true;
…

Andrei F
- 4,205
- 9
- 35
- 66
1
vote
1 answer
JsInterop for Java primitive object wrapper classes
GWT makes collection classes available via JsInterop out of the box, but the same is not true for Integer, Long, Char and so on (primitive object wrapper classes).
Is there a reason for that?
In order to make those Java emulated classes available…

micgala
- 86
- 6
1
vote
1 answer
GWT JsInterop - extending a Java interface in JavaScript
So, we are trying to use JsInterop so that in our GWT application, we can use some modules created externally in JavaScript.
We have an interface that have some contract, some methods that must be implemented by all views.
For example:
package…

micgala
- 86
- 6
1
vote
0 answers
Wrap a GWT widget in a web component
I am trying to use gwt with web component, I'd like to reuse some widgets by wrapping them (and use them in a microfrontend scenario but one step a time). I am using jsinterop in a dummy project but I can't use my widget in the javascript part. I…

Francesco
- 1,742
- 5
- 44
- 78
1
vote
0 answers
How to import and use JsInterop with LibGDX (Gradle)?
I cannot figure out how to import and use JsInterop in a LibGDX project.
My GWT version in html build.gradle is correct:
gwt {
gwtVersion='2.8.0'
...
In project's build.gradle :
project(":html") {
apply plugin: "gwt"
...
…

Zezi Reeds
- 1,286
- 1
- 16
- 29
1
vote
0 answers
GWT com.google.gwt.json.client.* JSON classes not supporting for jsinterop?
When I try to compile and run the code
JSONValue jv = JSONParser.parseStrict(jsonString);
I got console message as following-
[WARN] Some stale types ([com.mycompany.gwtjs.client.AjaxForm$1,
com.mycompany.gwtjs.client.AjaxForm$1$1,
…

Thangaraj
- 53
- 1
- 7
1
vote
1 answer
Gwt elemental2: How can I convert between a gwt JavaScript object, and a JsInterop object?
Lets say I have a com.google.gwt.dom.client.Document gwtDocument node and I want to convert it to a elemental2.dom.Document?
Since Document extends JavaScriptObject I assumed I could do something like:
elemental2.dom.Document elementalDoc =…

Casey Jordan
- 1,204
- 1
- 20
- 39
1
vote
0 answers
GWT 2.8.1 JsInterop is not workin
I am new to GWT, I am trying to implement sample program using JsInterop
but it does not work.
JavaScript code:-

Rishu
- 31
- 2
1
vote
0 answers
GWT Interop: Get complete stack trace
Given the following simple Java class defined using JSInterop:
@JsType(name = "ExceptionTest", namespace = JsPackage.GLOBAL)
public class ExceptionTest {
public static void triggerTypeErrorWhenNull(Object object) {
object.toString();
…

mxro
- 6,588
- 4
- 35
- 38
1
vote
1 answer
JsInterop wrapping a javascript function property
I am working with GWT 2.8, and I am working on a wrapper for a javascript library.
One of the properties of a javascript class I am trying to wrap is a function. I would like the wrapper to work as closely as possible to the native javascript. How…

user1888863
- 399
- 2
- 9
1
vote
1 answer
How to expose JS patch function of Incremental DOM library in GWT app using @JsInterop
I would like to use Incremental DOM library in my GWT app.
https://google.github.io/incremental-dom/#about
As I am coming from the Java world, I struggle with concepts of JavaScript namespaces and modules. I was able to use Closure Compiler with…

morisil
- 1,345
- 8
- 19
1
vote
1 answer
Why is my @JsProperty not preserving the name in javascript?
I have the following class:
@JsType
public class Options {
@JsProperty
public boolean extractUrlsWithoutProtocol;
public Options(boolean extractUrlsWithoutProtocol) {
this.extractUrlsWithoutProtocol =…

Michael Wiles
- 20,902
- 18
- 71
- 101
0
votes
1 answer
Problem efficiently mapping a native JavaScript library variable parameter API with Elemental2 / GWT?
I want to use a specific native JavaScript library (DataTables) from GWT using Elemental2.
The initialization API for the library is of the type:
$('#example').DataTable({
paging: false,
ordering: false,
info: false,
…

Sandro
- 120
- 1
- 5
0
votes
2 answers
Call Java object from JS
I'm trying to interact with a JS api, once a video is loaded/fails to load/is viewed I'd like to send back an event using EventSystem. I got the first part working, where I call the native JS apis:
@JsType(namespace = JsPackage.GLOBAL, name =…

kacpr
- 440
- 1
- 8
- 28
0
votes
0 answers
How to access window.opener while using gwt.jsinterop
I want to access the javascript window.opener via gwt.jsinterop. So i defined my interface like this:
@JsType(isNative=true, namespace=JsPackage.GLOBAL, name="window")
public class Window {
@JsProperty
public static native Window…

Rüdiger
- 21
- 1