Show TOC Start of Content Area

Syntax documentation WorkProtect API  Locate the document in its SAP Library structure

The EPCF WorkProtect API provides methods to get the status about unsaved data on the page.

EPCM.setDirty(indicator)

This method sets the status of the dirty indicator to true or false.

Parameter Description

Parameter

Type

Description

indicator

boolean

Status of the dirty indicator:

true: Page contains unsaved data.

false: Page is clean – no unsaved data.

Usage

<SCRIPT language ="JavaScript">

   if  (storedValue != enteredValue){

     changedData["DataKey"] =   enteredValue;

     EPCM.setDirty( true );

   }

 

   // do other actions ...

 

   storeArrayToDataBase(changedData);

   EPCM.setDirty( true );

 

</SCRIPT>

 

EPCM.getDirty()

This method returns the current setting of the dirty indicator as type boolean. The WorkProtect feature uses this method to get the dirty indicator for the entire portal page.

Usage

<SCRIPT language ="JavaScript">

   var isDirty = EPCM.getDirty( );

   alert("Component " + (isDirty) ? "clean" : "dirty" );

</SCRIPT>

 

EPCM.getGlobalDirty()

This method returns the current setting of the dirty indicator as type boolean. The difference to the getDirty() method is, that the getGlobalDirty() method checks the dirty flag of all iViews on the page and returns a true value if at least one of the iViews had a dirty flag set to true, and false otherwise.

Usage

<SCRIPT language ="JavaScript">

   var isDirty = EPCM.getGlobalDirty( );

   alert("One component " + (isDirty) ? "clean" : "dirty" );

</SCRIPT>

 

End of Content Area