Support Article

Adding new page to page list does not trigger dirty state



Closing or cancelling case after adding new page to the page list should result in warning popup "This page is asking you to confirm that you want to leave...".

When a new row is added to a grid in the user portal this warning does not appear when the row has been added using a data transform run from a context outside of the grid.  For example a link or button outside of the grid.

Error Messages

Not applicable

Steps to Reproduce

  1. Add a new page to a page list.
  2. Close the page.

Root Cause

In doExplorerFormIsDirty function in pzpega_ui_doc_dirtyhandling JS, there is a check for presence of pega.u.NavigateTopHandler object.

If the object is present, the function returns false. 

In case of a lightweight dynamic container (present in User portal), the pega.u.NavigateTopHandler object is present; but it is not present in screen layout (present in Manager portal)  or normal dynamic container.

In case of single-document portals using lightweight dynamic container, for example User portal, the dirty confirmation is not shown by default.


Set the flag through a script in the UserWorkForm HTML Fragment, to resolve the issue:
    function setDirtyOverride() {
        pega.u.d.gDirtyOverride = true;

The below is the version from my test system that has resolved the problem.  You should add this script to the custom application version of UserWorkForm if one exists, otherwise you will need to save a copy into the application ruleset.

The flag can then be set via the Run Script action as shown below.

Published August 5, 2016 - Updated September 12, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.