The confirmation should at least contain the following message: "Are you sure that you want to leave the current object without saving?"
Without this confirmation, problems similar with the one described in the Q211224 (Q211224) issue can occur.
Proposed Solution:
Change the behaviour so that every non-saving action (next object, navigating, closing the browser tab etc.) recognizes unsaved changes and asks if the user really wants to cancel editing without saving changes.
This is how every desktop app (even notepad) and popular webapps like google mail handle it.
UI.Web - Show a confirmation dialog when a user leaves a page with modified data or changes the current object
Answers approved by DevExpress Support
We have implemented the functionality described in this ticket. It will be included in our next update(s).
Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.
ASP.NET applications can now prevent loss of unsaved data by displaying a warning dialog if a user attempts to close the browser tab, or clicks an Action whose execution may lead to loss of unsaved data.
This behavior is enabled by default. You can disable it using the ConfirmUnsavedChanges property of the Options node in the Model Editor invoked for the ASP.NET project:
The option above is global. To enable/disable the confirmation dialog for a specific Action, use the ConfirmUnsavedChanges property of the ActionDesign | Action node.
By default, the IModelActionWeb.ConfirmUnsavedChanges option is set to true for the following Actions:
NextObject
PreviousObject
New
DialogCancel
DialogClose
ChooseTheme
Refresh
Cancel
Edit
Logoff
ChangeVariant
These are Actions, whose execution may lead to loss of unsaved data. If you have implemented a custom Action, you can set the IModelActionWeb.ConfirmUnsavedChanges property to true to display a warning dialog when your Action is executing and there are unsaved data modifications in the current View.
- v15.2.4Download Official Update
@Mun Loong Sam: This improvement is available in v15.2, which should be out in a few weeks or so.
Refer to the How to provide an "Unsaved Changes Warning" in a Web application like in WinForms application ? and web grid inline editing tickets for temporary solutions for both detail and list forms respectively.
Thanks,
Dennis
Well put! Another upvote for this feature from my side… I really like what you guys did regarding "unsaved changes" with the new batch edit feature of the ASPxGridView… Why not apply this expertise to XAF :) ? It really is an important feature which causes so much trouble with every single customer we delivered XAF solutions to.
Is some grand design behind this issue?
@OSHKG's workaround involving big red banner about necessity of frequent saving is quite unprofessional. Please make XAF more user friendly - if users have hard time working with XAF flow, we developers wouldn't be allowed to use this great framework to make products that lag behind present-day user experience.
C'mon, even your clients implement this feature on their own: https://github.com/Terricks/XAFBootstrap/commits/master
Best Regards
Hi Guys,
Please take a look at my blog post Confirm unsaved changes to avoid losing data when navigating to another web page - YOUR FEEDBACK IS NEEDED that is devoted to handling this scenario.
I am looking forward to hearing from you once you have had an opportunity to test the provided solution for v15.1.8+ in your real projects. Thanks.
As you have fixed the issue "XAF.Web - changes made in DetailView, when a user clicks the Next or Previous button, are not rolled back" this becomes more important! Now people can go to the next object and their changes will get lost without them noticing it!
Hello Alexander,
We consider that this behavior is logical, and shouldn't cause problems. When you click on another item in the navigation history or navigation bar without saving, you are expecting that changes will be lost. Why should the behavior of the Next and Previous button be different? I'm sure that the most end-users don't even know that there was such a possibility (I didn't know before your issue).
Please explain to your customers that they should click the Save (SaveAndNew, SaveAndClose) button each time they want to save changes in the Web application - it should be enough.
Thanks,
Anatol
Currently I have red text on the top of each website saying:
"When editing please click "Save" on a regular basis! The button "Next object" does not save." It seems to fix the issue for me.
But obviously the end-user (and honestly I can't blame him) expected it to save or at least to warn about unsaved changes. "No message" means "everything fine" and not "all the work lost" :).