Firstly, yes, I already searched and already found this answer:
GWT JSNI - string passing problem
I am trying to call a java method from a JSNI method, but they will not go anywhere. I tried the advice above, but it still won't work.
Here is the code:
public native void initCustomListeners(MapmakerMapViewPresenter.MyView view) /*-{ //public native void initCustomListeners() /*-{ $wnd.getLocationDescriptions = function(lng, lat) { $entry( view.@org.jason.mapmaker.client.view.MapmakerMapViewImpl ::getLocationDescriptions(DD)(lng, lat)); } $wnd.google.maps.event.addListener(map, 'click', function(event) { var lat = event.latLng.lat().toFixed(3); var lng = event.latLng.lng().toFixed(3); alert("(" + lat + ", " + lng + ")"); $wnd.getLocationDescriptions(lng, lat); alert("Test!"); }); }-*/; @Override public void getLocationDescriptions(double lng, double lat) { getUiHandlers().doGetLocationDescriptions(lng, lat); }
Can anyone help me out?
Jason
Jason source share