/changeprompteditorarea

Prompt the user if there are unsaved changes in the Backoffice Editor Area

Primary LanguageJavaApache License 2.0Apache-2.0

Archived on 2020-02-16
I recently switched jobs away from SAP Commerce development

Change Prompt Editor Area

ko-fi

Prompt/Warn the user that he/she will lose unsaved changes when a new item loaded.

Demo

Installation

  1. Download the latest release

  2. Unpack the zip to hybris/bin/custom/

  3. Rename the folder (remove the version suffix from the name)

    mv changeprompteditorarea-* changeprompteditorarea
    
  4. Add changeprompteditorarea to your localextensions.xml

  5. Build

Notes

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.

Known Limitations

  • "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...