This is with reference to this example:
package mypackage;
public MyUtilityClass
{
public static int computeLoanInterest(int amt, float interestRate,
int term) { ... }
public static native void exportStaticMethod() /*-{
$wnd.computeLoanInterest =
$entry(@mypackage.MyUtilityClass::computeLoanInterest(IFI));
}-*/;
}
I need to know the javascript code to call this function. If I use <input type="button" onclick=computeLoanInterest(1,2.1,1)/> the example works, but var x = computeLoanInterest(1,2.1,1) does not work. Can someone tell me what am I missing here.
var x = computeLoanInterest(1,2.1,1); makes value of x undefined
var x = window.computeLoanInterest(1,2.1,1) shows type mismatch error
Thanks Ravi
$wnd.computeLoanInterest = @mypackage.MyUtilityClass::computeLoanInterest(IFI):)