sorry, but same result

On Aug 13, 4:36 pm, olivier nouguier <olivier.nougu...@gmail.com>
wrote:
> Hi,
>  I cannot test from here but could you try to replace (call and function
> definiotion of course ;) :
>
>  initializeCBs();
>
> by:
>
>  initializeCBs(this);
>
> HIH
>
>
>
> On Thu, Aug 13, 2009 at 4:30 PM, CI-CUBE <e...@ci-cube.info> wrote:
>
> > 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 =
> > th...@com.egr.x4gpl.apps.saturn.client.application::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
>
> --
> A coward is incapable of exhibiting love; it is the prerogative of the
> brave.
> --
> Mohandas Gandhi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to