I need to call an instance Java method from handwritten Javascript. In the GWT docs it is explained how to do this with static methods and classes and it works fine:
http://code.google.com/p/google-web-toolkit-doc-1-6/wiki/DevGuideJavaFromJavaScript (Calling a Java Method from Handwritten JavaScript)
public MyUtilityClass
{
public static int computeLoanInterest(int amt, float interestRate,
int term) { ... }
public static native void exportStaticMethod() /*-{
$wnd.computeLoanInterest =
@mypackage.MyUtilityClass::computeLoanInterest(IFI);
}-*/;
}
Is it possible to do this? I tried several different combinations, declaring the native methods and using this.@ and instance.@ with no success.
Thanks