I have extended the PersistentDashboard to ExtPersistentDashboard to add tenant_id field as I am using this add-on in multi-tenants environment.
I have created view for the extended Entity that includes the field “code” but the following exception seems to indicate that the view doesn;t include that field.
Here is the error:
java.lang.IllegalStateException: Cannot get unfetched attribute [code] from detached object com.inteacc.erp.entity.dashboard.ExtPersistentDashboard-8fc3f8f7-f620-16f0-58d4-1f329c090a1e [detached].
at org.eclipse.persistence.internal.queries.EntityFetchGroup.onUnfetchedAttribute(EntityFetchGroup.java:100)
at com.haulmont.cuba.core.sys.persistence.CubaEntityFetchGroup.onUnfetchedAttribute(CubaEntityFetchGroup.java:74)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.processUnfetchedAttribute(EntityManagerImpl.java:2998)
at com.haulmont.chile.core.model.impl.AbstractInstance._persistence_checkFetched(AbstractInstance.java)
at com.haulmont.addon.dashboard.entity.PersistentDashboard._persistence_get_code(PersistentDashboard.java)
at com.haulmont.addon.dashboard.entity.PersistentDashboard.getCode(PersistentDashboard.java:64)
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.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:71)
at com.haulmont.chile.core.model.impl.AbstractInstance.getValue(AbstractInstance.java:96)
at com.haulmont.cuba.core.entity.BaseGenericIdEntity.getValue(BaseGenericIdEntity.java:146)
at com.haulmont.chile.core.model.utils.InstanceUtils.getValueEx(InstanceUtils.java:129)
at com.haulmont.chile.core.model.impl.AbstractInstance.getValueEx(AbstractInstance.java:139)
at com.haulmont.cuba.gui.components.data.table.DatasourceTableItems.getItemValue(DatasourceTableItems.java:119)
at com.haulmont.cuba.web.gui.components.table.TableItemWrapper.getPropertyValue(TableItemWrapper.java:74)
at com.haulmont.cuba.web.gui.components.table.TableItemPropertyWrapper.getValue(TableItemPropertyWrapper.java:34)
at com.haulmont.cuba.web.gui.components.WebAbstractTable.formatCellValue(WebAbstractTable.java:1128)
at com.haulmont.cuba.web.widgets.CubaTable.formatPropertyValue(CubaTable.java:317)
at com.haulmont.cuba.web.widgets.CubaTable.getPropertyValue(CubaTable.java:233)
at com.vaadin.v7.ui.Table.parseItemIdToCells(Table.java:2355)
at com.vaadin.v7.ui.Table.getVisibleCellsNoCache(Table.java:2203)
at com.vaadin.v7.ui.Table.refreshRenderedCells(Table.java:1746)
at com.haulmont.cuba.web.widgets.CubaGroupTable.refreshRenderedCells(CubaGroupTable.java:747)
at com.vaadin.v7.ui.Table.refreshRowCache(Table.java:2654)
at com.haulmont.cuba.web.widgets.CubaTable.refreshRowCache(CubaTable.java:1017)
at com.vaadin.v7.ui.Table.containerItemSetChange(Table.java:4556)
at com.haulmont.cuba.web.gui.components.table.TableDataContainer.fireItemSetChanged(TableDataContainer.java:165)
at com.haulmont.cuba.web.gui.components.table.TableDataContainer.datasourceItemSetChanged(TableDataContainer.java:278)
at com.haulmont.bali.events.EventHub.publish(EventHub.java:170)
at com.haulmont.cuba.gui.components.data.table.DatasourceTableItems.datasourceCollectionChanged(DatasourceTableItems.java:67)
at com.haulmont.bali.events.EventRouter.fireEvent(EventRouter.java:45)
at com.haulmont.cuba.gui.data.impl.AbstractCollectionDatasource.fireCollectionChanged(AbstractCollectionDatasource.java:373)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.afterRefresh(CollectionDatasourceImpl.java:198)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:163)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:119)
at com.haulmont.cuba.gui.data.impl.GroupDatasourceImpl.setSuspended(GroupDatasourceImpl.java:182)
at com.haulmont.cuba.gui.data.impl.DsContextImpl.resumeSuspended(DsContextImpl.java:84)
at com.haulmont.cuba.web.sys.WebScreens.afterShowWindow(WebScreens.java:582)
at com.haulmont.cuba.web.sys.WebScreens.show(WebScreens.java:462)
at com.haulmont.cuba.web.sys.WebScreens.showFromNavigation(WebScreens.java:534)
at com.haulmont.cuba.gui.config.MenuItemCommands$ScreenCommand.run(MenuItemCommands.java:213)
at com.haulmont.cuba.web.sys.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:264)
at com.haulmont.cuba.web.sys.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:249)
at com.haulmont.cuba.web.gui.components.mainwindow.WebSideMenu$MenuItemImpl.menuSelected(WebSideMenu.java:569)
at com.haulmont.cuba.web.widgets.CubaSideMenu$1.menuItemTriggered(CubaSideMenu.java:90)
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.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:431)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:396)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1577)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
here is the view
<view entity="erp_ExtPersistentDashboard" name="extPersistentDashboard-view" extends="_local">
<property name="group" view="_minimal"/>
</view>