I have a entity called account with a tree of all the account, such as bank with children account checking, saving, stock…, cash with us, cnd, euro children account, etc.
I have a transaction entity with the account name column.
I want to display a tree with account name on the left window and when a user clicks a node which is account name, all the transactions for the account will be showing on the right window, and the user can edit, create, filter the transactions as well.
I am trying to create the tree as the first step. but have some issues here:
error:
22:04:46.750 INFO c.h.c.s.a.AuthenticationManagerBean - Logged in: 51be9cdb-6e69-2dfe-7c49-a844a811a4ad [mike]
22:04:46.991 INFO c.h.c.c.sys.AbstractViewRepository - Initializing views
22:04:50.461 INFO c.h.cuba.core.app.PersistenceManager - Loading statistics cache
22:04:50.921 ERROR com.haulmont.cuba.web.log.AppLog - Exception:
java.lang.RuntimeException: Push failed
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:177) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:152) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.ui.UI.push(UI.java:1562) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinSession.unlock(VaadinSession.java:1004) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:43) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1435) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:361) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:312) ~[cuba-web-6.10.4.jar:6.10.4]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:203) ~[cuba-web-6.10.4.jar:6.10.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:107) ~[cuba-web-6.10.4.jar:6.10.4]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[catalina.jar:8.5.33]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[catalina.jar:8.5.33]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) ~[catalina.jar:8.5.33]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[catalina.jar:8.5.33]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[catalina.jar:8.5.33]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) ~[tomcat-coyote.jar:8.5.33]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:8.5.33]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) ~[tomcat-coyote.jar:8.5.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) ~[tomcat-coyote.jar:8.5.33]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:8.5.33]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_191]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.33]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.haulmont.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:73) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.chile.core.model.impl.AbstractInstance.getValue(AbstractInstance.java:102) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.cuba.core.entity.BaseGenericIdEntity.getValue(BaseGenericIdEntity.java:139) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.cuba.gui.data.impl.HierarchicalDatasourceImpl.getRootItemIds(HierarchicalDatasourceImpl.java:86) ~[cuba-gui-6.10.4.jar:6.10.4]
at com.haulmont.cuba.web.gui.data.HierarchicalDsWrapper.rootItemIds(HierarchicalDsWrapper.java:59) ~[cuba-web-6.10.4.jar:6.10.4]
at com.vaadin.ui.Tree.rootItemIds(Tree.java:915) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.ui.Tree.paintContent(Tree.java:675) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.haulmont.cuba.web.toolkit.ui.CubaTree.paintContent(CubaTree.java:133) ~[cuba-web-6.10.4.jar:6.10.4]
at com.vaadin.server.LegacyPaint.paint(LegacyPaint.java:65) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.LegacyUidlWriter.write(LegacyUidlWriter.java:82) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:131) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:174) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
… 36 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at com.haulmont.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:71) ~[cuba-global-6.10.4.jar:6.10.4]
… 47 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot get unfetched attribute [parent] from detached object com.company.cvr.entity.Account-17257cf2-f960-9bb0-7ffa-cf4cce76f662 [detached].
at org.eclipse.persistence.internal.queries.EntityFetchGroup.onUnfetchedAttribute(EntityFetchGroup.java:98) ~[eclipselink-2.6.2.cuba24.jar:2.6.2.cuba24]
at com.haulmont.cuba.core.sys.persistence.CubaEntityFetchGroup.onUnfetchedAttribute(CubaEntityFetchGroup.java:74) ~[cuba-global-6.10.4.jar:6.10.4]
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.processUnfetchedAttribute(EntityManagerImpl.java:2846) ~[eclipselink-2.6.2.cuba24.jar:2.6.2.cuba24]
at com.haulmont.chile.core.model.impl.AbstractInstance._persistence_checkFetched(AbstractInstance.java) ~[cuba-global-6.10.4.jar:6.10.4]
at com.company.cvr.entity.Account._persistence_get_parent(Account.java) ~[app-global-0.1-SNAPSHOT.jar:na]
at com.company.cvr.entity.Account.getParent(Account.java:31) ~[app-global-0.1-SNAPSHOT.jar:na]
… 52 common frames omitted
22:05:36.170 ERROR com.haulmont.cuba.web.log.AppLog - Exception:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: Push failed
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_191]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_191]
at com.vaadin.server.VaadinSession$FutureAccess.get(VaadinSession.java:124) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService.runPendingAccessTasks(VaadinService.java:1864) [vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinSession.unlock(VaadinSession.java:996) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService.ensureAccessQueuePurged(VaadinService.java:1824) [vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService.accessSession(VaadinService.java:1790) [vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinSession.access(VaadinSession.java:1401) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService.fireSessionDestroy(VaadinService.java:460) [vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinSession.valueUnbound(VaadinSession.java:324) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1819) ~[catalina.jar:8.5.33]
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:879) ~[catalina.jar:8.5.33]
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:766) ~[catalina.jar:8.5.33]
at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1266) ~[catalina.jar:8.5.33]
at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:171) ~[catalina.jar:8.5.33]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:177) ~[cuba-web-6.10.4.jar:6.10.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:107) ~[cuba-web-6.10.4.jar:6.10.4]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[catalina.jar:8.5.33]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[catalina.jar:8.5.33]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) ~[catalina.jar:8.5.33]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[catalina.jar:8.5.33]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[catalina.jar:8.5.33]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) ~[tomcat-coyote.jar:8.5.33]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:8.5.33]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) ~[tomcat-coyote.jar:8.5.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) ~[tomcat-coyote.jar:8.5.33]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:8.5.33]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_191]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.33]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]
Caused by: java.lang.RuntimeException: Push failed
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:177) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:152) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.ui.UI.close(UI.java:1259) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService$1$1.run(VaadinService.java:481) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.ui.UI.accessSynchronously(UI.java:1392) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService$1.run(VaadinService.java:471) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_191]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_191]
at com.vaadin.server.VaadinService.runPendingAccessTasks(VaadinService.java:1861) [vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
… 40 common frames omitted
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.haulmont.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:73) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.chile.core.model.impl.AbstractInstance.getValue(AbstractInstance.java:102) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.cuba.core.entity.BaseGenericIdEntity.getValue(BaseGenericIdEntity.java:139) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.cuba.gui.data.impl.HierarchicalDatasourceImpl.getRootItemIds(HierarchicalDatasourceImpl.java:86) ~[cuba-gui-6.10.4.jar:6.10.4]
at com.haulmont.cuba.web.gui.data.HierarchicalDsWrapper.rootItemIds(HierarchicalDsWrapper.java:59) ~[cuba-web-6.10.4.jar:6.10.4]
at com.vaadin.ui.Tree.rootItemIds(Tree.java:915) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.ui.Tree.paintContent(Tree.java:675) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.haulmont.cuba.web.toolkit.ui.CubaTree.paintContent(CubaTree.java:133) ~[cuba-web-6.10.4.jar:6.10.4]
at com.vaadin.server.LegacyPaint.paint(LegacyPaint.java:65) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.LegacyUidlWriter.write(LegacyUidlWriter.java:82) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:131) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:174) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
… 48 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at com.haulmont.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:71) ~[cuba-global-6.10.4.jar:6.10.4]
… 59 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot get unfetched attribute [parent] from detached object com.company.cvr.entity.Account-17257cf2-f960-9bb0-7ffa-cf4cce76f662 [detached].
at org.eclipse.persistence.internal.queries.EntityFetchGroup.onUnfetchedAttribute(EntityFetchGroup.java:98) ~[eclipselink-2.6.2.cuba24.jar:2.6.2.cuba24]
at com.haulmont.cuba.core.sys.persistence.CubaEntityFetchGroup.onUnfetchedAttribute(CubaEntityFetchGroup.java:74) ~[cuba-global-6.10.4.jar:6.10.4]
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.processUnfetchedAttribute(EntityManagerImpl.java:2846) ~[eclipselink-2.6.2.cuba24.jar:2.6.2.cuba24]
at com.haulmont.chile.core.model.impl.AbstractInstance._persistence_checkFetched(AbstractInstance.java) ~[cuba-global-6.10.4.jar:6.10.4]
at com.company.cvr.entity.Account._persistence_get_parent(Account.java) ~[app-global-0.1-SNAPSHOT.jar:na]
at com.company.cvr.entity.Account.getParent(Account.java:31) ~[app-global-0.1-SNAPSHOT.jar:na]
… 64 common frames omitted
22:05:41.060 INFO c.h.c.s.a.AuthenticationManagerBean - Logged in: 08269dd1-bd23-5be3-0437-1d4ae5d833b1 [mike]
22:05:46.237 INFO c.h.c.s.a.AuthenticationManagerBean - Logged in: fefda15f-b905-026a-f7b8-af7546bb8477 [admin]
22:05:46.350 ERROR com.haulmont.cuba.web.log.AppLog - Exception:
java.lang.RuntimeException: Push failed
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:177) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:152) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.ui.UI.push(UI.java:1562) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinSession.unlock(VaadinSession.java:1004) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:43) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1435) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:361) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:312) ~[cuba-web-6.10.4.jar:6.10.4]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:203) ~[cuba-web-6.10.4.jar:6.10.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:107) ~[cuba-web-6.10.4.jar:6.10.4]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[catalina.jar:8.5.33]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[catalina.jar:8.5.33]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) ~[catalina.jar:8.5.33]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) ~[catalina.jar:8.5.33]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[catalina.jar:8.5.33]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[catalina.jar:8.5.33]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) ~[tomcat-coyote.jar:8.5.33]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:8.5.33]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) ~[tomcat-coyote.jar:8.5.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) ~[tomcat-coyote.jar:8.5.33]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:8.5.33]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_191]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.33]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.haulmont.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:73) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.chile.core.model.impl.AbstractInstance.getValue(AbstractInstance.java:102) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.cuba.core.entity.BaseGenericIdEntity.getValue(BaseGenericIdEntity.java:139) ~[cuba-global-6.10.4.jar:6.10.4]
at com.haulmont.cuba.gui.data.impl.HierarchicalDatasourceImpl.getRootItemIds(HierarchicalDatasourceImpl.java:86) ~[cuba-gui-6.10.4.jar:6.10.4]
at com.haulmont.cuba.web.gui.data.HierarchicalDsWrapper.rootItemIds(HierarchicalDsWrapper.java:59) ~[cuba-web-6.10.4.jar:6.10.4]
at com.vaadin.ui.Tree.rootItemIds(Tree.java:915) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.ui.Tree.paintContent(Tree.java:675) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.haulmont.cuba.web.toolkit.ui.CubaTree.paintContent(CubaTree.java:133) ~[cuba-web-6.10.4.jar:6.10.4]
at com.vaadin.server.LegacyPaint.paint(LegacyPaint.java:65) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.LegacyUidlWriter.write(LegacyUidlWriter.java:82) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:131) ~[vaadin-server-7.7.15.cuba.3.jar:7.7.15.cuba.3]
I have the tree displayed. but I want user to click on a node and click on a button which is “EDIT”, so user can edit the node. or click create button to create a new node.
I have a tree on the left panel and display transaction on the right. I did that following your answer, eveything works fine. but when I click on the root, it suppose to show all the transactions, but it showing none. because the query is set to show the transaction with the account name as “ALL”, but there is no transaction account is “ALL”.
How can I change the datasource to query transaction table with the all children account when I click a parent account name.
for example: I have cheque account with two children account 1. bank one cheque account 2. bank two cheque account, when I click cheque account, I want to show all the bank one and bank two acount transaction. now there is nothing showing because the account name is bank one cheque account or bank two cheque account.
Then instead of linking the datasources with the parameter referring the master datasource (ds$accountsDs) in select t from cvr$Transaction t where t.account.id = :ds$accountsDs, use a parameter that can be passed to datasource.refresh() method:
select t from cvr$Transaction t where t.account.id = :custom$accountId
Add ItemChangeListener to the master datasource and invoke transactions datasource refresh() providing a desired value for the accountId parameter. See Datasource Listeners.
Thanks for the answer. I’m trying to follow the approach. I can add listener. But how can I create change the value of the parameters? I tried to search from document, no luck.
<collectionDatasource id="transactionsesDs"
class="com.company.cvr.entity.Transactions"
datasourceClass="com.company.cvr.web.account.TransactionsForTree"
view="transactions-view">
<query>
<![CDATA[select t from cvr$Transactions t
where t.account.id = :custom$selectedaccount]]>
</query>
</collectionDatasource>
If you need a query for hierarchy, it’s not that simple.
You can use an approach which is implemented in the framework for working with hierarchical access groups: in addition to the sec$Group entity, there is the sec$GroupHierarchy entity which is maintained by GroupEntityListener. The GroupHierarchy entity stores lists of parents for each group.
If you create an AccountHierarchy entity then a query for all Transactions for some Account and all sub-accounts can look as follows:
select t from cvr$Transactions t
where t.account.id in
(select h.parent.id from cvr$AccountHierarchy h
where h.account.id = :custom$selectedaccount)