Does GWT JSNI support callbacks? -
I am creating a GWT app that uses Web SQL Local Storage (). The problem is that the web uses the SQL API callback function as a logic.
Is it possible to pass "Java" callback to JSNI?
Yes, it does:
Private static country zero doThingWithCallback () / * - {var self = this; Var Callback Fn = $ Entry (Function (Val) {Late @ Com.your.package.aclass.a Method (Ljava / lang / String;) (val);}); $ Wnd.someApiThatTakesACallback (callbackFn); } - * /;
To memorize two things:
-
$ entry ()
to track code while using the debugger GWT reminds -
var refers to
function - elsethis
inside the self = itthis
function
Comments
Post a Comment