maybe you should try "console.log" or "window.alert" instead of document.write..
andi (vom fon) On 09.03.2011, at 18:02, Pierre <[email protected]> wrote: > Hi all, > > I am experiencing problems when using GWT / JSNI : > > For tests, let's have a parent class with a JSNI method such as > public class TestParent { > public native void show()/*-{ > $doc.write("PARENT JSNI"); > }-*/; > } > > and a child class overriding the parent JSNI method, such as > public class TestChild extends TestParent { > @Override > public void show() { > super.show(); > RootPanel.get().add(new HTML("TestChild.show")); > } > } > > and a basic EntryPoint : > public class Helloworld implements EntryPoint { > > public void onModuleLoad() { > TestChild t = new TestChild(); > t.show(); > } > } > > When calling the TestChild .show() method, we could assume getting the > result : > "PARENT JSNI" + "TestChild.show" > > And in fact, we get the following result : > On Google Chrome 11 in development mode with GWT plugin : > "PARENT JSNI" and an error in the GWT plugin Development mode tab : > > [DEBUG] [helloworld] - Rebinding > com.google.gwt.user.client.impl.WindowImpl > [DEBUG] [helloworld] - Checking rule <replace-with > class='com.google.gwt.user.client.impl.WindowImplIE'/> > [ERROR] [helloworld] - Error while executing the JavaScript provider > for property 'user.agent' > [ERROR] [helloworld] - Unable to get value of property 'user.agent' > [ERROR] [helloworld] - Deferred binding failed for > 'com.google.gwt.user.client.impl.WindowImpl'; expect subsequent > failures > [ERROR] [helloworld] - Unable to load module entry point class > fr.helloworld.client.Helloworld (see associated exception for details) > [ERROR] [helloworld] - Failed to load module 'helloworld' from user > agent 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like > Gecko) Chrome/11.0.696.0 Safari/534.24' at localhost:2222 > > This error stops any further instruction in the application. > > On Firefox 3.6 in development mode with GWT plugin: > "PARENT JSNI" + "TestChild.show" (fine) but the browser is redirected > to http://127.0.0.1:8888/helloworld/hosted.html?helloworld and keeps > loading forever > > When building the GWT project, the result are also different : > Chrome : > correct , works fine > > Firefox 3.6 : > correct text displayed but the browser is redirected to helloworld/ > F0E90C8F76FAE58BAB597BFF7095D19A.cache.html (compiled version for > firefox user agent) and keeps loading forever. I encountered the > problem on a real application, and of course the compiled application > was unable to run correctly. > > Should I conclude that developer should never try to override JSNI > methods ? > Should we guess that it is a GWT compiler bug ? > > -- > 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. > -- 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.
