Hi! I am Javier from Spain and I need some help ;).
I am tried to set an ID to an iframe created with an HtmlPane in SmartGwt 2.0.6.
The reason because I want to set an id to the iframe is that I want to call the JavaScript functions in the map.html.
Debuggin with Chrome I can see randoms IDs but with Firefox there is no any ID.
Because I can not set the ID I always recibe the same error when I try to call JavaScript:
Best regards!
Thanks!
I am tried to set an ID to an iframe created with an HtmlPane in SmartGwt 2.0.6.
Code:
mapLayout = new VLayout(); mHtmlPane = new HTMLFlow(); mHtmlPane.setShowEdges(true); mHtmlPane.setContentsURL("map.html"); mHtmlPane.setID("miMapa"); mHtmlPane.setContentsType(ContentsType.PAGE); mapLayout.addMember(mHtmlPane);
Debuggin with Chrome I can see randoms IDs but with Firefox there is no any ID.
Code:
public static native void goToTracking() /*-{ $wnd.document.getElementById("miMapa").contentWindow.alerta(); }-*/;
Code:
com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot read property 'contentWindow' of null at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214) at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Unknown Source
Thanks!
Comment