Archived on 2020-02-16
I recently switched jobs away from SAP Commerce development
Prompt/Warn the user that he/she will lose unsaved changes when a new item loaded.
-
Download the latest release
-
Unpack the zip to
hybris/bin/custom/
-
Rename the folder (remove the version suffix from the name)
mv changeprompteditorarea-* changeprompteditorarea
-
Add
changeprompteditorarea
to yourlocalextensions.xml
-
Build
Getting the custom controller to work involves patching the OOTB backoffice widget
config files via buildcallback.xml
, because there is no easy way yet(!) to
modify / replace existing widgets.
-
"Save & Continue" does not show any validation warnings. If the dirty item has validation errors, the button is not available.
-
This extension only modifies the Backoffice Editor Area so it prompts the user when the currently displayed item is "dirty".
This means that the list view will display a different selected item, as will the tree view if you change types, if the user cancels.
To prevent those changes too, one would have to create some kind of logical gate between all involved widgets that block the propagation of the change if the item in the editor area is "dirty", and maybe even send additional socket events to reset widgets to their previous state...