Native method cannot access $wnd in GWT Designer

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Native method cannot access $wnd in GWT Designer

Postby arikthered » Mon Dec 11, 2006 6:48 am

whenever I create a native method in a client class and access it:
Code: Select all
public class EditorViewer implements EntryPoint
{
   public native void create() /*-{
      $wnd.alert( "hi" );
   }-*/;

   public void onModuleLoad()
   {
      // ...
      create();
   }
}


I get a "Failure to load module" and the following stack trace:

Code: Select all
com.google.gwt.core.client.JavaScriptException: JavaScript TypeError exception: '$wnd' is undefined
   at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:396)
   at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeVoid(ModuleSpaceIE6.java:283)
   at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:127)
   at org.codehaus.plexus.web.editor.client.EditorViewer.create(EditorViewer.java:68)


Shouldn't $wnd always be defined? Is this a defect in the GWT Designer deployment/runtime? I am using version 1.0.1 (I had to, to solve another error).
arikthered
 
Posts: 1
Joined: Sun Dec 10, 2006 8:30 pm

Re: Native method cannot access $wnd in GWT Designer

Postby Eric Clayberg » Tue Dec 12, 2006 5:38 am

A couple of us tried your example using GWT 1.2.22 and the latest GWT Designer 1.0.1 build and did not have a problem. We pasted your code in an eisting entry point and ran it using Run As > GWT Application.

We could not reproduce your exception, so it is likely a local configuration issue on your end.

All I can suggest is to mke sure that you are using the latets version of both GWT and GWT Designer.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests