Read Only page still asking for confirmation before closing

Hi,

I have a Trx Line Detail page, which are opened by 2 different pages in a dialog view mode. One of the page allow editing, while the other is for viewing/read-only. I noticed that when closing the read-only page, there are confirmation box popping up asking for save confirmation. How do i disable this behaviour when the page is in readOnly mode?

Thank you very much.

Hi

I added view action for groupTable, opened view and edit tabs, made changes and closed view without any dialogs. So your behaviour is probably caused by some implicit changes are made in your code. Can you attach sample minimal project that reproduces it, please?

I’m not using a view action, I added an item double click listener which will open a dialog in a read-only mode.

@Subscribe("trxLinesDataGrid")
    public void onTrxLinesDataGridItemDoubleClick(final ItemDoubleClickEvent<TrxLine> event) {
        DialogWindow<TrxLineDetailView> window = dialogWindows.view(this, TrxLineDetailView.class)
                .build();
        TrxLine trxLine = event.getItem();
        trxLine.setTrx(getEditedEntity());
        window.getView().setReadOnly(true);
        window.setWidth("80%");
        window.setHeight("80%");
        window.setCloseOnEsc(true);
        window.getView().setEntityToEdit(trxLine);
        window.open();
    }

this looks like data change operation, try to emit this entity save just after it