In-line editable table throws exception

If I make the composition table editable, i get the following exception

   java.lang.IllegalStateException: Table datasource is null
	at com.haulmont.cuba.web.gui.components.table.WebTableFieldFactory.findOptionsDatasource(WebTableFieldFactory.java:196)
	at com.haulmont.cuba.web.gui.components.table.WebTableFieldFactory.getOptions(WebTableFieldFactory.java:159)
	at com.haulmont.cuba.gui.components.factories.AbstractFieldFactory.createField(AbstractFieldFactory.java:50)
	at com.haulmont.cuba.web.gui.components.table.WebTableFieldFactory.createField(WebTableFieldFactory.java:75)
	at com.haulmont.cuba.web.widgets.CubaTable.getPropertyValue(CubaTable.java:220)
	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.vaadin.v7.ui.Table.attach(Table.java:4260)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643)
	at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670)
	at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:571)
	at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:178)
	at com.vaadin.ui.CssLayout.addComponent(CssLayout.java:121)
	at com.haulmont.cuba.web.sys.WebScreens.showThisTabWindow(WebScreens.java:1682)
	at com.haulmont.cuba.web.sys.WebScreens.show(WebScreens.java:439)
	at com.haulmont.cuba.gui.screen.Screen.show(Screen.java:309)
	at com.haulmont.cuba.gui.actions.list.EditAction.actionPerform(EditAction.java:144)
	at com.haulmont.cuba.web.gui.components.WebButton.buttonClicked(WebButton.java:62)
	at com.haulmont.cuba.web.widgets.CubaButton.fireClick(CubaButton.java:76)
	at com.vaadin.ui.Button$1.click(Button.java:57)
	at sun.reflect.GeneratedMethodAccessor502.invoke(Unknown Source)
	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:742)
	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:52)
	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:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	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)

image

When I turn the table uneditable, it works fine but I can’t edit it anymore inline.

Thanks for your help about how the composition table can be editable in-line.

Hi,

Could please you provide more details on your problem:

  1. Platform version
  2. Screen XML/Controller
  3. Enitty relations

The demo project is appreciated.

Gleb

Hi Gleb
I am using the latest version of Studio 9.1 and Platform 7.05.

In a brand new project created in new platform this problem is not arising. This is a new screen created in V7 but in an existing project that was created in legacy version.

Here is the requested files.
PurchaseRequisitionEdit - controller.docx (9.9 KB)
Purchase reqiosition Entity.docx (8.9 KB)
Purchase requisition Line Entity.docx (6.9 KB)
Purchase requisition XML.docx (9.1 KB)

Gleb
I have resolved this issue. I removed the data container from the table and added again to refresh the columns in the table that has helped avoiding this error.

What could help is, if we get such specific message from Studio pinpointing where is there issue instead of saying Table datasource is null since it is not the case rather a bit down there one or more columns in the Table are not in the View of the data source.

Hi Gleb
I am coming back with the same problem arised in new project created in V7 (Studio 9.1).

In the attached project you will see when clicking on the Create button in the Material Requisition Editor screen (to add lines) then you will get the same error message.

This error didn;t come in the first hand but after I have added the option datasource of the Material.
democuba7.zip (88.5 KB)

image

Hi,

The problem is that you use optionsDatasource instead of optionsContainer and Studio warns you about that

image

Gleb

Thank you.