Hi
I have successfully added the dashboard add-on to my project. But now I have encountered an exception and have a question below:
- I am able to create a Widget that is shown under the widget Template as below:
when I drag “salesWidget(screen)” to my dashboard layout, I get the following exception:
java.lang.ClassCastException: com.company.demodashboard.web.dashboard.Saleswidget cannot be cast to com.haulmont.cuba.gui.components.Window
at com.haulmont.cuba.gui.components.WindowDelegate.wrapBy(WindowDelegate.java:78)
at com.haulmont.cuba.web.gui.WebWindow.wrapBy(WebWindow.java:1371)
at com.haulmont.cuba.gui.WindowManager.wrapByCustomClass(WindowManager.java:1204)
at com.haulmont.cuba.gui.WindowManager.createWindow(WindowManager.java:561)
at com.haulmont.cuba.gui.WindowManager.openWindow(WindowManager.java:750)
at com.haulmont.cuba.web.WebWindowManager.openWindow(WebWindowManager.java:158)
at com.haulmont.cuba.web.gui.components.WebFrame.openWindow(WebFrame.java:298)
at com.haulmont.cuba.gui.components.AbstractFrame.openWindow(AbstractFrame.java:484)
at com.haulmont.addon.dashboard.web.widget.screen.ScreenWidget.init(ScreenWidget.java:66)
at com.haulmont.cuba.gui.xml.layout.loaders.FrameLoader$FrameLoaderInitTask.execute(FrameLoader.java:271)
at com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext$InitTaskExecutor.run(ComponentLoaderContext.java:273)
at com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext.executeInitTasks(ComponentLoaderContext.java:162)
at com.haulmont.cuba.gui.WindowManager.openFrame(WindowManager.java:1014)
at com.haulmont.cuba.gui.WindowManager.openFrame(WindowManager.java:964)
at com.haulmont.cuba.web.gui.components.WebFrame.openFrame(WebFrame.java:412)
at com.haulmont.cuba.gui.components.AbstractFrame.openFrame(AbstractFrame.java:569)
at com.haulmont.addon.dashboard.web.dashboard.tools.componentfactory.CanvasUiComponentsFactory.createCanvasWidgetLayout(CanvasUiComponentsFactory.java:114)
at com.haulmont.addon.dashboard.web.dashboard.tools.componentfactory.CanvasDropComponentsFactory.createCanvasWidgetLayout(CanvasDropComponentsFactory.java:118)
at com.haulmont.addon.dashboard.web.dashboard.tools.DashboardModelConverter.modelToContainer(DashboardModelConverter.java:72)
at com.haulmont.addon.dashboard.web.dashboard.tools.DashboardModelConverter.modelToContainer(DashboardModelConverter.java:100)
at com.haulmont.addon.dashboard.web.dashboard.tools.DashboardModelConverter.modelToContainer(DashboardModelConverter.java:100)
at com.haulmont.addon.dashboard.web.dashboard.frames.editor.canvas.CanvasFrame.updateLayout(CanvasFrame.java:76)
at com.haulmont.addon.dashboard.web.dashboard.frames.editor.canvas.CanvasEditorFrame.updateLayout(CanvasEditorFrame.java:64)
at com.haulmont.addon.dashboard.web.dashboard.frames.editor.canvas.CanvasEditorFrame.onLayoutRefreshedEvent(CanvasEditorFrame.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.haulmont.cuba.gui.events.sys.UiEventListenerMethodAdapter.doInvoke(UiEventListenerMethodAdapter.java:211)
at com.haulmont.cuba.gui.events.sys.UiEventListenerMethodAdapter.processEvent(UiEventListenerMethodAdapter.java:137)
at com.haulmont.cuba.gui.events.sys.UiEventListenerMethodAdapter.onApplicationEvent(UiEventListenerMethodAdapter.java:96)
at com.haulmont.cuba.gui.events.sys.UiEventsMulticasterImpl.invokeListener(UiEventsMulticasterImpl.java:73)
at com.haulmont.cuba.gui.events.sys.UiEventsMulticasterImpl.multicastEvent(UiEventsMulticasterImpl.java:66)
at com.haulmont.cuba.web.sys.WebEvents.publish(WebEvents.java:31)
at com.haulmont.addon.dashboard.web.dashboard.tools.DropLayoutTools.reorderWidgetsAndPushEvents(DropLayoutTools.java:138)
at com.haulmont.addon.dashboard.web.dashboard.tools.DropLayoutTools.addComponent(DropLayoutTools.java:112)
at com.haulmont.addon.dashboard.web.dashboard.frames.editor.DashboardEdit.widgetAddedToTreeEventListener(DashboardEdit.java:361)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.haulmont.cuba.gui.events.sys.UiEventListenerMethodAdapter.doInvoke(UiEventListenerMethodAdapter.java:211)
at com.haulmont.cuba.gui.events.sys.UiEventListenerMethodAdapter.processEvent(UiEventListenerMethodAdapter.java:137)
at com.haulmont.cuba.gui.events.sys.UiEventListenerMethodAdapter.onApplicationEvent(UiEventListenerMethodAdapter.java:96)
at com.haulmont.cuba.gui.events.sys.UiEventsMulticasterImpl.invokeListener(UiEventsMulticasterImpl.java:73)
at com.haulmont.cuba.gui.events.sys.UiEventsMulticasterImpl.multicastEvent(UiEventsMulticasterImpl.java:66)
at com.haulmont.cuba.web.sys.WebEvents.publish(WebEvents.java:31)
at com.haulmont.addon.dashboard.web.dashboard.tools.drophandler.TreeDropHandler.drop(TreeDropHandler.java:66)
- How can I create Widgets that shows up in under the Widgets like you have in the demo application?
I have attached a demo application with necessary Entity and screens for additional information.
Thanks for your help.
demoDashboard.zip (97.1 KB)
regards