Unnecessary Save/Don’t Save/Cancel confirmation

When I open detail screen in readyOnly mode, I noticed the application pop-up a window to Save/Don’t Save/Cancel confirmation every time after visiting any details page, though I haven’t change anything being ready-only view.

Is there any way, I can turn this off especially when my screen is in read-Only mode?

regards
Mortoza

Hi,

When the Unsaved changes confirmation dialog shows without user interaction, it means that you have incorrectly handled an entity initialization. This means that an entity has been changed after it was set to an instance container. Read-only mode just disables input fields and save actions and doesn’t affect the instance container or any custom code that changes the entity.

As a quick fix, you can override the hasUnsavedChanges() method and add check of read only mode:

@Override
public boolean hasUnsavedChanges() {
    if (isReadOnly()) {
        return false;
    }

    return super.hasUnsavedChanges();
}

Regards,
Gleb