Suppress message about unsaved changes on the Cuba platform

I have a search screen with authors, and I load the data using a custom query in init from AuthorsBrowse :: AbstractLookup. I am manipulating the data that I want to display, but the changes should not be saved.

If I close the tab, I will open the dialog box for this message:

You have unsaved changes. Do you want to discard unsaved changes?

How can I suppress this message?

+4
source share
2 answers

This message appears if any data source has been modified.

If you want to suppress the message, you need to add the datasource attribute (which has been changed) allowCommit="false", for example:

<collectionDatasource id="authorsDs"
                      class="com.haulmont.workshop.core.entity.Author"
                      view="_local"  allowCommit="false">
    <query>
        <![CDATA[
        select e from ws$Author e where e.status = 10
        ]]>
    </query>
</collectionDatasource>
+4
source

, Window.Committable. isModified(), .

AbstractEditor , isModified() :

@Override
public boolean isModified() {
    return getDsContext() != null && getDsContext().isModified();
}

Window.Committable false isModified().

+3

All Articles