Ability to warn user of unsaved changes when leaving a page - Mendix Forum

Ability to warn user of unsaved changes when leaving a page

27

I’ve had a few clients this year ask for the ability to warn the user about unsaved changes when they try to leave a page. The user should then be able to either discard the changes and continue the navigation or cancel the navigation.

 

I’m thinking of a drag&drop widget that can be placed on a page and the developer could tell the widget which inputs to watch. The widget would then internally keep track of the original values and the changed values to determine when to show the message. (maybe not exactly this, but prevent the need for the developer to add an on change action to every input)

 

The widget needs the following customization:

 

The widget needs to detect leaving the page via:

FYI custom messaging cannot be used to customize the message shown in Chrome when the browser tab is closed (deprecated). Chrome forces the use of its own messaging, but that is sufficient.

asked
2 answers

I’ve made a widget that warns the user on browser close, browser tab close, and provides a means of blocking Mendix navigation https://marketplace.mendix.com/link/component/207417 

Created

This is a great idea! Many clients have been asking for this 

Created