Syntax documentationWorkProtect API Locate 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.

Example Example

  1. <SCRIPT language ="JavaScript">
    if  (storedValue != enteredValue){ 
    changedData["DataKey"] =   enteredValue;
    EPCM.setDirty( true );
    }
    
    // do other actions ...
    storeArrayToDataBase(changedData);
    EPCM.setDirty( true );
    
    </SCRIPT>
    
End of the code.
EPCM.getDirty()

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

Example Example

  1. <SCRIPT language ="JavaScript">
    var isDirty = EPCM.getDirty( );
    alert("Component has " + (isDirty) ? " " : "no " + "unsaved data);
    </SCRIPT>
    
End of the code.
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.

Example Example

  1. <SCRIPT language ="JavaScript">
    var isDirty = EPCM.getGlobalDirty( );
    alert("Component has " + (isDirty) ? " " : "no " + "unsaved data);
    </SCRIPT>
    
End of the code.