主表和子表关联,添加子表数据的时候有下拉数据,保存数据后不能编辑

主表A和子表B关联,添加子表信息的时候有个字段C,字段C的数据是通过下拉选项选的;数据填完同时保存主表A和子表B后编辑主表的时候报错,子表B的字段C不能正常显示。

报什么错了吗?是不是 view 的配置有问题?

22:36:42.088 ERROR com.haulmont.cuba.web.log.AppLog        - Exception in com.haulmont.cuba.web.widgets.CubaButton: 
com.vaadin.server.ServerRpcManager$RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:157) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:431) [vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:396) [vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260) [vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1577) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329) ~[cuba-web-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215) ~[cuba-web-7.0.5.jar:7.0.5]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[servlet-api.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:9.0.19]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.19]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-websocket.jar:9.0.19]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.19]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.19]
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
	at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:108) ~[cuba-web-7.0.5.jar:7.0.5]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.19]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.19]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[catalina.jar:9.0.19]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[catalina.jar:9.0.19]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[catalina.jar:9.0.19]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[catalina.jar:9.0.19]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[catalina.jar:9.0.19]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) ~[catalina.jar:9.0.19]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[catalina.jar:9.0.19]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[catalina.jar:9.0.19]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-coyote.jar:9.0.19]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:9.0.19]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836) ~[tomcat-coyote.jar:9.0.19]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1747) ~[tomcat-coyote.jar:9.0.19]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:9.0.19]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_181]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_181]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:9.0.19]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]
Caused by: java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	... 38 common frames omitted
Caused by: com.vaadin.v7.ui.Table$CacheUpdateException: Error during Table cache update.
	at com.vaadin.v7.ui.Table.maybeThrowCacheUpdateExceptions(Table.java:1764) ~[vaadin-compatibility-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.v7.ui.Table.refreshRenderedCells(Table.java:1753) ~[vaadin-compatibility-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.v7.ui.Table.attach(Table.java:4260) ~[vaadin-compatibility-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:571) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:178) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.ui.CssLayout.addComponent(CssLayout.java:121) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.haulmont.cuba.web.sys.WebScreens.showThisTabWindow(WebScreens.java:1682) ~[cuba-web-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.sys.WebScreens.show(WebScreens.java:439) ~[cuba-web-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.gui.screen.Screen.show(Screen.java:309) ~[cuba-gui-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.gui.actions.list.EditAction.actionPerform(EditAction.java:144) ~[cuba-gui-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.gui.components.WebButton.buttonClicked(WebButton.java:62) ~[cuba-web-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.widgets.CubaButton.fireClick(CubaButton.java:76) ~[cuba-web-widgets-7.0.5.jar:na]
	at com.vaadin.ui.Button$1.click(Button.java:57) ~[vaadin-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	... 42 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-7.0.5.jar:7.0.5]
	at com.haulmont.chile.core.model.impl.AbstractInstance.getValue(AbstractInstance.java:96) ~[cuba-global-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.core.entity.BaseGenericIdEntity.getValue(BaseGenericIdEntity.java:146) ~[cuba-global-7.0.5.jar:7.0.5]
	at com.haulmont.chile.core.model.utils.InstanceUtils.getValueEx(InstanceUtils.java:129) ~[cuba-global-7.0.5.jar:7.0.5]
	at com.haulmont.chile.core.model.impl.AbstractInstance.getValueEx(AbstractInstance.java:139) ~[cuba-global-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.gui.components.data.table.ContainerTableItems.getItemValue(ContainerTableItems.java:131) ~[cuba-gui-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.gui.components.table.TableItemWrapper.getPropertyValue(TableItemWrapper.java:74) ~[cuba-web-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.gui.components.table.TableItemPropertyWrapper.getValue(TableItemPropertyWrapper.java:34) ~[cuba-web-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.gui.components.WebAbstractTable.formatCellValue(WebAbstractTable.java:1115) ~[cuba-web-7.0.5.jar:7.0.5]
	at com.haulmont.cuba.web.widgets.CubaTable.formatPropertyValue(CubaTable.java:317) ~[cuba-web-widgets-7.0.5.jar:na]
	at com.haulmont.cuba.web.widgets.CubaTable.getPropertyValue(CubaTable.java:233) ~[cuba-web-widgets-7.0.5.jar:na]
	at com.vaadin.v7.ui.Table.parseItemIdToCells(Table.java:2355) ~[vaadin-compatibility-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.v7.ui.Table.getVisibleCellsNoCache(Table.java:2203) ~[vaadin-compatibility-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	at com.vaadin.v7.ui.Table.refreshRenderedCells(Table.java:1746) ~[vaadin-compatibility-server-8.6.4-11-cuba.jar:8.6.4-11-cuba]
	... 65 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
	at com.haulmont.chile.core.model.utils.MethodsCache.invokeGetter(MethodsCache.java:71) ~[cuba-global-7.0.5.jar:7.0.5]
	... 78 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot get unfetched attribute [station] from detached object com.company.edyj.entity.OpticalFibre-cddd21c6-2fd3-5513-a0d8-9019c2362c04 [detached].
	at org.eclipse.persistence.internal.queries.EntityFetchGroup.onUnfetchedAttribute(EntityFetchGroup.java:100) ~[org.eclipse.persistence.core-2.7.3-2-cuba.jar:na]
	at com.haulmont.cuba.core.sys.persistence.CubaEntityFetchGroup.onUnfetchedAttribute(CubaEntityFetchGroup.java:74) ~[cuba-global-7.0.5.jar:7.0.5]
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.processUnfetchedAttribute(EntityManagerImpl.java:2998) ~[org.eclipse.persistence.jpa-2.7.3-2-cuba.jar:na]
	at com.haulmont.chile.core.model.impl.AbstractInstance._persistence_checkFetched(AbstractInstance.java) ~[cuba-global-7.0.5.jar:7.0.5]
	at com.company.edyj.entity.OpticalFibre._persistence_get_station(OpticalFibre.java) ~[app-global-0.1-SNAPSHOT.jar:na]
	at com.company.edyj.entity.OpticalFibre.getStation(OpticalFibre.java:47) ~[app-global-0.1-SNAPSHOT.jar:na]
	... 82 common frames omitted

需要给 com.company.edyj.entity.OpticalFibre 配置能获取 station 的视图,然后在该界面加载 OpticalFibre 的数据容器中使用这个视图。

建议阅读文档视图部分。

这是子表的view,子表的view在主表的编辑界面上怎么加

已解决已解决已解决已解决已解决