Hi, I try to use canviz library in my GWT application.
1) Insert <script> elements into my html main page.
<script type="text/javascript" src="js/prototype.js"></
script>
<script type="text/javascript" src="js/path.js"></script>
<script type="text/javascript" src="js/canviz.js"></script>
<script type="text/javascript" src="js/x11colors.js"></
script>
2) In java class, I create HTML object and set:
image1.setHTML("<div id=\"image_2\"></div>");
3) Then I create native method:
public static native void getImage2(String dot) /*-{
var canviz;
canviz = new $wnd.Canviz("image_2");
canviz.load(dot);
}-*/;
When I push the button and call method getImage2, then I get this
error:
com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot
set property 'innerHTML' of null
stack: TypeError: Cannot set property 'innerHTML' of null
at klass.load (
http://127.0.0.1:8889/js/canviz.js:464:31)
at unknown source
at __gwt_jsInvoke (
http://127.0.0.1:8889/clan/hosted.html?clan:
70:35)
at eval at <anonymous> (
http://127.0.0.1:8889/clan/hosted.html?
clan:54:12)
at XMLHttpRequest.<anonymous> (unknown source)
at unknown source
at __gwt_jsInvoke (
http://127.0.0.1:8889/clan/hosted.html?clan:
70:35)
at eval at <anonymous> (
http://127.0.0.1:8889/clan/hosted.html?
clan:54:12)
at XMLHttpRequest.onreadystatechange (unknown source)
type: non_object_property_store
arguments: innerHTML,
__gwt_ObjectId: 3497
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann
elServer.java:
195)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
120)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
507)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
264)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j
ava:
91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.GeneratedMethodAccessor12.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.jav
a:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java :
1669)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChan
nelServer.java:
401)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java :
222)
at java.lang.Thread.run(Unknown Source)
I know, it's probably problem with GWT, but if somebody has skills
with GWT and Canviz, could you give me some suggestion please, thanks.