I'm Tinoue, I want to write these in JSNI method for using 'message' in GWT.
private native void setUp(JavaScriptObject method) /*-{
window.addEventListener('message', method, false);
}-*/;
My hope is invoke some method when some message come. Especially the method that is written outside of JSNI.
All of codes:
public void setUpMessaging () {
setUp(get());
}
private native JavaScriptObject get () /*-{
return this.@somePackage::mtd(Lcom/google/gwt/user/client/Event;);
}-*/;
public static void mtd (Event e) {
//some description,,,
}
private native void setUp (JavaScriptObject method) /*-{
window.addEventListener('message', method, false);
}-*/;
But now, the "mtd" method never work without "static". This is normal, of course I know.
But I don't want to using "static" here.
Someone know some solution?
Regards.