Cuba Studio 7.0 breaks on setting rows datasource in table

At least I think that’s what’s happening. To fix another problem, I removed all the grid layouts from a screen, and got this error for one of the tables:

Validation error

java.lang.reflect.InvocationTargetException
	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.studio.ui.sd.layout.model.prop.TableColumnsComponentProperty.setValue(TableColumnsComponentProperty.java:56)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.setComponentProperties(ComponentModelMapper.java:535)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:396)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:452)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:452)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:452)
	at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.editModel(ScreenLayoutDesigner.java:205)
	at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.lambda$activate$5(ScreenLayoutDesigner.java:377)
	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:955)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
	at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.activate(ScreenLayoutDesigner.java:350)
	at com.haulmont.studio.intellij.ui.sd.ScreenDesignerEditor.lambda$selectNotify$1(ScreenDesignerEditor.java:108)
	at com.vaadin.ui.UI.accessSynchronously(UI.java:1392)
	at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.accessSynchronously(ScreenLayoutDesigner.java:346)
	at com.haulmont.studio.intellij.ui.sd.ScreenDesignerEditor.selectNotify(ScreenDesignerEditor.java:108)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:781)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:722)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NullPointerException
	at com.haulmont.studio.ui.sd.layout.LocCaptionProvider.getLocalizedAttributeName(LocCaptionProvider.java:147)
	at com.haulmont.studio.ui.sd.layout.LocCaptionProvider.getLocalizedAttributeName(LocCaptionProvider.java:156)
	at com.haulmont.studio.ui.sd.layout.LocCaptionProvider.getLocalizedAttributeName(LocCaptionProvider.java:156)
	at com.haulmont.studio.ui.sd.layout.LocCaptionProvider.getAttributeCaptionById(LocCaptionProvider.java:124)
	at com.haulmont.studio.ui.sd.layout.ModelHelper.attributeNameLocalized(ModelHelper.java:93)
	at com.haulmont.studio.ui.sd.layout.gui.impl.AbstractTable.processColumnElement(AbstractTable.java:362)
	at com.haulmont.studio.ui.sd.layout.gui.impl.AbstractTable.setColumns(AbstractTable.java:307)
	... 42 more

Might be related to setting the rows element on the table, because the editor loaded when I removed, but then would not let me set it. While I was trying to set it though, the editor destroyed all the other data source settings by removing the ```id```` attributes from the XML. Not a nice thing to do.

Hi.
If it is possible, could you share the xml file of your screen to help us investigate the problem?

I can certainly do that:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd" caption="msg://editorCaption"
        class="com.test.peer.web.assignment.AssignmentEdit" datasource="assignmentDs" focusComponent="fieldGroup"
        messagesPack="com.test.peer.web.assignment">
    <dsContext>
        <datasource id="assignmentDs" class="com.test.peer.entity.Assignment" loadDynamicAttributes="true"
                    view="assignment-edit-view">
            <collectionDatasource id="assignmentDocumentsDs" property="assignmentDocuments"/>
            <collectionDatasource id="responseDocumentsDs" property="responseDocuments"/>
            <collectionDatasource id="assignmentAlertsDs" property="assignmentAlerts"/>
            <collectionDatasource id="assignmentMessagesDs" property="messages"/>
        </datasource>
    </dsContext>
    <dialogMode height="AUTO" modal="false" width="600"/>
    <layout expand="windowActions" spacing="true">
        <groupBox id="assigneeBox" caption="msg://Assignee">
            <fieldGroup id="fieldGroup" datasource="assignmentDs" responsive="true">
                <column width="250px">
                    <field property="assignee"/>
                    <field property="dateAssigned"/>
                    <field property="estimatedCompletionDate"/>
                    <field property="actualCompletionDate"/>
                    <field property="completionStatus"/>
                    <field property="note" rows="6"/>
                </column>
            </fieldGroup>
        </groupBox>
        <groupBox id="assigmentAlertsBox" caption="msg://assignmentAlertsGroupBox" responsive="true" spacing="true">
            <table id="assignmentAlertsTable" height="300px" responsive="true" width="100%">
                <columns>
                    <column id="createTs"/>
                    <column id="message"/>
                    <column id="alertType"/>
                </columns>
                <rows datasource="assignmentAlertsDs"/>
            </table>
        </groupBox>
        <groupBox id="assignmentDocumentsBox" caption="msg://assignmentDocuments" collapsable="true">
            <table id="assignmentDocumentsTable" height="200px" width="100%">
                <actions>
                    <action id="create"/>
                    <action id="edit"/>
                    <action id="remove"/>
                </actions>
                <columns>
                    <column id="title"/>
                    <column id="file"/>
                    <column id="download" align="CENTER" caption="msg://downloadFile"
                            generator="generateDownloadAssignmentDocumentCell"/>
                </columns>
                <rows datasource="assignmentDocumentsDs"/>
                <buttonsPanel id="assignmentDocumentsButtonPanel">
                    <button action="assignmentDocumentsTable.create"/>
                    <button action="assignmentDocumentsTable.edit"/>
                    <button action="assignmentDocumentsTable.remove"/>
                </buttonsPanel>
            </table>
        </groupBox>
        <groupBox id="responseDocumentsBox" caption="msg://ResponseDocuments" collapsable="true" spacing="true">
            <table id="responseDocumentsTable" height="200px" width="100%">
                <actions>
                    <action id="create"/>
                    <action id="edit"/>
                    <action id="remove"/>
                </actions>
                <columns>
                    <column id="title"/>
                    <column id="file"/>
                    <column id="download" align="CENTER" caption="msg://downloadFile"
                            generator="generateDownloadResponseDocumentCell"/>
                </columns>
                <rows datasource="responseDocumentsDs"/>
                <buttonsPanel id="responseDocumentsButtonPanel">
                    <button action="responseDocumentsTable.create"/>
                    <button action="assignmentDocumentsTable.edit"/>
                    <button action="assignmentDocumentsTable.remove"/>
                </buttonsPanel>
            </table>
        </groupBox>
        <buttonsPanel>
            <linkButton id="gotoManuscriptButton" caption="msg://gotoManuscript"
                        description="msg://gotoManuscriptDescription" disableOnClick="true"
                        invoke="onGotoManuscriptButtonClick" responsive="true"/>
        </buttonsPanel>
        <groupBox id="messagesBox" caption="msg://messagesBoxTitle" collapsable="true" height="300px" responsive="true"
                  spacing="true">
            <table id="assignmentMessagesTable" height="100%" multiLineCells="true" responsive="true" width="100%">
                <actions>
                    <action id="create"/>
                </actions>
                <columns>
                    <column id="createTs" caption="msg://creationDate"/>
                    <column id="message" link="true" linkScreen="peer$AssignmentMessage.edit"
                            linkScreenOpenType="DIALOG" maxTextLength="60"/>
                    <column id="person" caption="msg://creatorTitle"/>
                </columns>
                <rows datasource="assignmentMessagesDs"/>
                <buttonsPanel>
                    <button id="newMessageButton" action="assignmentMessagesTable.create" caption="msg://newMessage"/>
                </buttonsPanel>
            </table>
        </groupBox>
        <groupBox id="holidaysGroupBox" caption="msg://holidaysGroupBoxTitle" height="300px" responsive="true"
                  spacing="true">
            <vbox id="holidayVBox" height="100%" spacing="true"/>
        </groupBox>
        <frame id="windowActions" width="AUTO" screen="editWindowActions"/>
    </layout>
</window>