I’m trying to get the returned value from a java method, but it returns something very strange: it returns the method itself written in javascript I think.
Here the code of the java method:
public String getNameToShow() {
return "Chart number 1";
}
and the javascript method:
public native void drawJSChart(String divId, int a, String jsData) /*-{
try {
//First create a script where to paste the jsData
var scriptID = this.@myPackage.MyClass::getNameToShow();
console.log(scriptID);
//Some code
} catch (e) {
console.error(e.message);
}
}-*/;
Thank you.
You have to pass the types of your Java function too. Writing it like this works: