Tuesday, October 6, 2015
Confirm unsaved changes to avoid losing data when navigating to another web page - YOUR FEEDBACK IS NEEDED
Imagine you are in an XAF ASP.NET app context and just edited a record in the DetailView or ListView directly (e.g., linked or unlinked related details, typed something in the text box, changed drop downs, etc.) and then accidentally clicked a navigation item or some other link within the app...If the Save Action was not explicitly executed before that accidental action took place, there is a risk of losing your recent edits...and sadly this sometimes happens. Thankfully, this is not the case for the WinForms platform, where it is already handled.
There are some custom-tailored solutions available in the Support Center (one, two), but they far from being ideal, to be honest.
As part of our continuous effort to improve the XAF Web UI (be sure to check it), the new v15.2 (should be out around December, as always) will contain a built-in solution for the aforementioned problem.
To help you test it today (not for production use), we are showing a preview of the new functionality in v15.1.8+. To test it live today, do the following:
0. Make you have v15.1.8+ installed (or download and install this hot fix build from October 2nd or later if this link expires);
1. Invoke the Model Editor for YourSolution.Web project;
2. Navigate to the Options node and set its ConfirmUnsavedChanges property to True.
0. We would greatly appreciate it if you could test this with your real projects and report any uncovered scenarios where this option was insufficient to us via the Support Center. Thanks in advance!
1. Please do not look for how it is implemented internally for now, just test the end result from the global ConfirmUnsavedChanges property in your apps, because there internals (e.g., names) are to be changed by the final release in v15.2.
2. There are additional options for a more granular control at the IModelActionWeb and even IModelMemberViewItemWeb levels in the Application Model.