WorkProtect APILocate this document in the navigation structure

The EPCF WorkProtect API provides methods to maintain the Dirty indicator through which a portal application informs the portal that it has unsaved data.. For background information, see WorkProtect Feature .

EPCM.setDirty(indicator)

Sets the boolean Dirty indicator to true if the page contains unsaved data, otherwise to false .

Sample Code
                  <SCRIPT language ="JavaScript">
if  (storedValue != enteredValue){ 
changedData["DataKey"] =   enteredValue;
EPCM.setDirty( true );
}
 
// do other actions ...
storeArrayToDataBase(changedData);
EPCM.setDirty( true );
 
</SCRIPT>

               

EPCM.getDirty()

Returns the current boolean value of the Dirty indicator for an iView.

Sample Code
                  <SCRIPT language ="JavaScript">
var isDirty = EPCM.getDirty( );
alert("Component has " + (isDirty) ? " " : "no " + "unsaved data);
</SCRIPT>

               

EPCM.getGlobalDirty()

Returns the current boolean value of the Dirty indicator for a page. This method checks the indicators of all iViews on the page and returns true if at least one of the iViews has its Dirty indicator set to true .

Sample Code
                  <SCRIPT language ="JavaScript">
var isDirty = EPCM.getGlobalDirty( );
alert("Component has " + (isDirty) ? " " : "no " + "unsaved data);
</SCRIPT>