gwt-jsinterop

JsInterop “com is not defined”

我的梦境 提交于 2019-12-08 02:55:47
问题 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 though. I have already: checked that generateJsInteropExports is enabled: My GdxDefinition.gwt.xml : <module rename-to="html"> <inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' /> <inherits name='com.badlogic.gdx.physics.box2d.box2d-gwt'

How to use XMLHttpRequest in GWT?

烈酒焚心 提交于 2019-12-06 03:52:17
问题 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: http://www.gwtproject.org/javadoc/latest/com/google/gwt/xhr/client/class-use/XMLHttpRequest.html 回答1: You haven't mentioned what GWT version you use, so I assume the latest one. It means 2.8.2 or newer. Elemental2 is the way to go As it is mentioned in comments above, Elemental2 is the right way. I will explain it a bit. If you

How to use XMLHttpRequest in GWT?

笑着哭i 提交于 2019-12-04 08:28:06
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: http://www.gwtproject.org/javadoc/latest/com/google/gwt/xhr/client/class-use/XMLHttpRequest.html You haven't mentioned what GWT version you use, so I assume the latest one. It means 2.8.2 or newer. Elemental2 is the way to go As it is mentioned in comments above, Elemental2 is the right way. I will explain it a bit. If you think about future-proof implementation (being aware of GWT3 / J2CL new approach), please do not use legacy

Implement Javascript Function Callback with GWT JsInterop

走远了吗. 提交于 2019-12-04 04:48:45
问题 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 of its fence'); } }); Here how I write it in Java : @JsType(namespace = JsPackage.GLOBAL, isNative = true, name = "Object") public class MarkerOptions { @JsProperty public double lat; @JsProperty public double lng; @JsProperty public boolean draggable; @JsProperty public Polygon fences; @JsFunction