I am currently creating a SmartGWT-based web application (using the portlet layout). Therefore, I have several "portlets" that basically expand the GWT window with various content. Now I want the portlet to display Dygraphs . So I created an implementation of the RPC service that returns a JSON string (based on a DataTable).
Since I cannot serialize the DataTable directly, I use
String json = JsonRenderer.renderDataTable(data, true, true).toString();
where "data" is of type DataTable.
Now this line is correctly passed to the client side, where I want to create a Dygraph. In this topic, someone suggested using
public static native DataTable toDataTable(String json)
/-{ return new $wnd.google.visualization.DataTable(eval("(" + json + ")")); }-/;
If I use this in my GWT client code, I get an error
com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.google.visualization is undefined
"" API ? ?
JSON datastring Dygraph? ...
!