HI,
I would like to add visualization support via the Google Visualization API to an existing GWT (2.1.1) and smartGWT (2.4) application.
I would like the "chart" to appear in a nested smartGWT layout container (e.g. a HLayout or a VLayout).
I followed the approach described in this post -> http://forums.smartclient.com/showpost.php?p=37754&postcount=2 and the Visualization Getting Started guide-> http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted
However, this results in the following [FATAL] Uncaught Exception:
If I comment out the call to "panel.addMember(pie)" and replace it with "RootPanel.get().add(pie)" no exception is thrown and the "chart" is rendered correctly (you can see it momentarily if you re-size the browser window) but as a child of the root panel. Which means it is hidden by the the other nested layout containers (e.g. North, West, East and South).
I would like to be able both size and position the "chart" using nested smartGWT layout containers if possible?
N.B. I also tried using the latest nightly build (e.g. smartGWT 2.5) as per this post -> http://code.google.com/p/smartgwt/issues/detail?id=405
Cheers
Rob
I would like to add visualization support via the Google Visualization API to an existing GWT (2.1.1) and smartGWT (2.4) application.
I would like the "chart" to appear in a nested smartGWT layout container (e.g. a HLayout or a VLayout).
I followed the approach described in this post -> http://forums.smartclient.com/showpost.php?p=37754&postcount=2 and the Visualization Getting Started guide-> http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted
Code:
@SuppressWarnings("deprecation") public void loadVisualizationApi() { // Create a callback to be called when the visualization API // has been loaded. Runnable onLoadCallback = new Runnable() { public void run() { // Create a pie chart visualization. PieChart pie = new PieChart(createTable(), createOptions()); // RootPanel.get().add(pie); panel.addMember(pie); } }; // Load the visualization api, passing the onLoadCallback // to be called when loading is complete. VisualizationUtils.loadVisualizationApi(onLoadCallback, PieChart.PACKAGE); } // The code for createTable() and createOptions()) is as per // the post mentioned above.
Code:
java.lang.AssertionError: A widget that has an existing parent widget may not be added to the detach list at com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java:136) at com.google.gwt.user.client.ui.RootPanel.get(RootPanel.java:211) at com.smartgwt.client.widgets.WidgetCanvas.onDraw(WidgetCanvas.java:39) at com.smartgwt.client.widgets.BaseWidget.rendered(BaseWidget.java:242) at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:157) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at com.smartgwt.client.widgets.layout.Layout.addMemberPostCreate(Layout.java) at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:1089) at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:1076) at au.com.uptick.serendipity.client.sales.view.DashboardsView$1.run(DashboardsView.java:76) at com.google.gwt.ajaxloader.client.ExceptionHelper.runProtected(ExceptionHelper.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:157) 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(Thread.java:619)
I would like to be able both size and position the "chart" using nested smartGWT layout containers if possible?
N.B. I also tried using the latest nightly build (e.g. smartGWT 2.5) as per this post -> http://code.google.com/p/smartgwt/issues/detail?id=405
Cheers
Rob
Comment