Hi,

I'm assigning a Java method M to a JS Callback. If M is static it
works. If M is non-static I get an error when calling the M via JS.

// THE BASE CLASS

package com.egr.x4gpl.apps.saturn.client;

abstract class Application {
        protected Application(String pUnused) {
                initializeCBs();
        }

        protected native void initializeCBs() /*-{
                $wnd.x4ResizeAppCB =
[email protected]::resizeCB();
                $wnd.x4ResizeAppCB();
        }-*/;

        abstract public void resizeCB();
}

// THE DERIVED CLASS

public class Saturn extends Application implements EntryPoint {
        Saturn() {
                super("Unused");
        }

        public native void resizeCB() /*-{
                $wnd.alert("non-static invoke");
        }-*/;

// THE ERROR (on calling, not on assingment)

[ERROR] Failed to create an instance of
'com.egr.x4gpl.apps.saturn.client.Saturn' via deferred binding
com.google.gwt.core.client.JavaScriptException: (RangeError): Instance
method 'resizeCB' needed a qualifying instance (did you forget to
prefix the call with 'this.'?)
 number: -2146828279
 description: Instance method 'resizeCB' needed a qualifying instance
(did you forget to prefix the call with 'this.'?)
        at com.egr.x4gpl.apps.saturn.client.Application.initializeCBs(Native
Method)
        at com.egr.x4gpl.apps.saturn.client.Application.<init>
(Application.java:5)
        at com.egr.x4gpl.apps.saturn.client.Saturn.<init>(Saturn.java:19)

TIA for any kinda support!

   Ekki
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to