Hi,
I have a entity serverDefinition, and another entity serverUserHistory, they are oneToMany relation, one serverDefiniton related to many serverUserHistory.
I have below screen designed, allow user to edit serverDefinition info and create serverUserHistory in one screen. The table related to serverUserHistoryDs has create action configured.
While I click create, then create an entry in subwindow, and click OK from editWindowActions, the new entry serverUserHistory commited.
Then while I click Cancel in serverDefiniton windows, it pop-up that “whether not save data”, I click “not save”.
But the new serverUserHistory data not rolledback, it commited to database.
How to change this behavior? I want that all DB change should be controlled by the parent window.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
caption="msg://editorCaption"
class="com.tcx.ucenter.web.serverdefinition.ServerDefinitionEdit"
datasource="serverDefinitionDs"
focusComponent="fieldGroup"
messagesPack="com.tcx.ucenter.web.serverdefinition">
<dsContext>
<datasource id="serverDefinitionDs"
class="com.tcx.ucenter.entity.ServerDefinition"
view="servdef-edit-view">
<collectionDatasource id="serverUserHistorysDs"
property="serverUserHistory">
</collectionDatasource>
</datasource>
</dsContext>
<dialogMode closeable="true"
height="600"
width="800"/>
<layout expand="windowActions"
spacing="true">
<fieldGroup id="fieldGroup"
datasource="serverDefinitionDs">
<column width="250px">
<field property="name"/>
<field property="apiUrl"/>
<field property="openSreenUrl"/>
<field property="serverType"/>
</column>
</fieldGroup>
<groupBox id="clientsBox"
caption="msg://com.tcx.ucenter.entity/ServerUserHistory.client">
<table id="serverUserHistorysTable"
height="200px"
width="100%">
<actions>
<action id="create"/>
<action id="remove"/>
</actions>
<columns>
<column id="serverDefinition.name"/>
<column id="client.user"/>
</columns>
<rows datasource="serverUserHistorysDs"/>
<buttonsPanel>
<button action="serverUserHistorysTable.create"/>
<button action="serverUserHistorysTable.remove"/>
</buttonsPanel>
</table>
</groupBox>
<frame id="windowActions"
screen="editWindowActions"/>
</layout>
</window>