Reputation: 153
Until I had this situation, it works :
JS side:
jsMethod : function(){...}
GWT Java side:
public static native void javaMethod(JavaScriptObject obj) /*-{
var test = null;
test = ... ;
test.jsMethod();
}-*/;
The problem is when I try to do something like this
JS side
jsMethod : function(a, b){... return string}
GWT Java side
String a = 'yes'
String b = 'no'
public static native void javaMethod(JavaScriptObject obj) /*-{
var test = null;
test = ... ;
var testString = null;
testString = test.jsMethod(a, b);
}-*/;
I would be to pass parameter from GWT to JS and then returns a String but I dont' know how to make it. Thank you .
Upvotes: 0
Views: 195
Reputation: 743
You can add parameters to the native JavaMethod
public static native String javaMethod(JavaScriptObject obj, String a, String b) /*-{
var test = null;
test = ... ;
var testString = null;
testString = test.jsMethod(a, b);
return testString;
}-*/;
Upvotes: 0
Reputation: 121998
Just like Java. Return a String.
public static native String javaMethod(JavaScriptObject obj) /*-{
var test = null;
test = ... ;
var testString = null;
testString = test.jsMethod(a, b);
return testString;
}-*/;
Upvotes: 0