How can I return a JavaScript function from JSNI in GWT? I tried it the following way:
/* JSNI method returning a js-function */
public static native JavaScriptObject native_getFunction() /*-{
return function(a,b){
//do some stuff with a,b
}
}-*/;
Store the function in a variable
/* outside from GWT: store the function in a variable */
JavaScriptObject myFunction = native_getFunction();
Using the function afterwards produces the following error message:
(TypeError): object is not a function
Does somebody know how to solve this problem?