Questions tagged [gwt-jsinterop]

39 questions
6
votes
1 answer

How to use XMLHttpRequest in GWT?

XMLHttpRequest is an alternative for HTTP calls from GWT client side and allows the control over all aspects of requests/responses. But how to use it? javadoc address:…
hadiafifi
  • 109
  • 6
3
votes
1 answer

Using JsConstructor to deal with multiple constructors

I have a class with two constructors: @JsType public class Dog implements Animal { String name; public Dog() { this.name = "Scooby Doo"; } public Dog(String name) { this.name = name; } } I get the following…
3
votes
1 answer

How to call a JavaScript function from GWT with jsInterop?

I tried the exampels in the docu https://docs.google.com/document/d/10fmlEYIHcyead_4R1S5wKGs1t2I7Fnp_PaNaa7XTEk0/edit# in the section @JsFunction but it gives only ideas to call java function from javascript. I have a javascript file included in my…
3
votes
0 answers

How to map JSON to POJO with dynamic property name using JsInterop

I have this kind of JSON that needs to be converted to POJO using JsInterop: "ACL": { "*": { "read": true }, "asdf123asdf": { "read": true, …
quarks
  • 33,478
  • 73
  • 290
  • 513
2
votes
1 answer

GWT / JSInterop / Eclipse Plugin / Production Build

I'm trying to use JSInterop. My project works perfectly in dev mode. But when I make a production build it does not work. In production and dev mode, my GWT code can access native JavaScript via JSInterop. However, my GWT classes are only…
Trade-Ideas Philip
  • 1,067
  • 12
  • 21
2
votes
1 answer

Should I stop using GSS etc. if I want to be ready for GWT 3?

I've ditched GWT Widgets in favor of JsInterop and Elemental2. But I'm still using modules from "gwt-user.jar" for GSS, Resources, and I18N. Are these modules likely to be supported in the next version of GWT? If not, is there a future-friendly…
ᴇʟᴇvᴀтᴇ
  • 12,285
  • 4
  • 43
  • 66
2
votes
1 answer

How does Js.cast() perform its type checking?

I'm using GWT 2.9 with elemental2-1.0.0-RC1. The following code throws a ClassCastException at runtime: DocumentRange documentRange = Js.cast(DomGlobal.document); // Fails Range range = documentRange.createRange(); // Never reaches here When I…
ᴇʟᴇvᴀтᴇ
  • 12,285
  • 4
  • 43
  • 66
2
votes
2 answers

JsInterop "com is not defined"

Trying to communicate with LibGDX project per Javascript with JsInterop. I am following the "Exporting a Java type to JavaScript" example here. It does not work: Uncaught ReferenceError 'com' is not defined. I am not getting any errors with gradle…
Zezi Reeds
  • 1,286
  • 1
  • 16
  • 29
2
votes
1 answer

Checking availability of a method or property in GWT Elemental2 overlays

Although a property or method may be provided in an Elemental2 overlay, how can you test whether it is actually defined in the underlying JS object? The DomGlobal class has a hasOwnProperty() method that seems to do what I want: // WORKS if…
ᴇʟᴇvᴀтᴇ
  • 12,285
  • 4
  • 43
  • 66
2
votes
1 answer

JsInterop - Get Value in Array

I created my own custom array in JsInterop: @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Array") public interface Array { public void push(T value); @JsProperty(name = "length") public int getLength(); …
Jason Washo
  • 536
  • 6
  • 22
2
votes
1 answer

Implement Javascript Function Callback with GWT JsInterop

I want to wrap a javascript code like this : map.addMarker({ lat: -12.043333, lng: -77.028333, draggable: true, fences: [polygon], outside: function(m, f){ alert('This marker has been moved outside…
the.wizard
  • 1,079
  • 1
  • 9
  • 25
1
vote
0 answers

Using GWT Jsinterop to change already existing object created with GWT Js wrapper

I'm using the GWT Highcharts wrapper created by moxiegroup and want to add/change functionality to my project but also slowly move away from the moxiegroup wrapper as it uses JSNI and isn't maintained anymore. I am having trouble with importing…
1
vote
3 answers

WebGPU JsInterop wrapper

I am trying to play around with WebGPU in GWT 2.9.0 using JsInterop and I face some problems trying to map all the WebGPU interfaces to Java. The definitions I refer to are located at https://www.w3.org/TR/webgpu/#idl-index 1) How do I map an…
Samwise
  • 86
  • 6
1
vote
1 answer

Javascript module function in GWT with JsInterop

Hoping this is way easier than I'm making it - I'm a Java coder, some inner Javascript aspects are a tad unfamiliar to me. Trying to embed the great CodeJar library inside a GWT panel. There's a pretty nice/simple example for CodeJar:
Rob Walker
  • 190
  • 1
  • 7
1
vote
1 answer

Controlling which classes GWT includes with -generateJsInteropExports

Can I control which classes are included when I use -generateJsInteropExports? I'm finding that when I use the flag, the JS output includes a bunch of classes that I'm not using in the project, but whose source appears in some of the packages I'm…
ᴇʟᴇvᴀтᴇ
  • 12,285
  • 4
  • 43
  • 66
1
2 3