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:

  1. $ entry () to track code while using the debugger GWT reminds
  2. var refers to this inside the self = it function - else this function

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -