!--a11y-->
Use of WorkProtect Mode 
WorkProtect mode offers the infrastructure for handling unsaved data in SAP Enterprise Portal. An application is called „dirty“ if the entered data has not yet been saved. Normally the data is lost if the user navigates to another application without having first stored the data. To prevent this from happening, the Client Framework (CF) of the portal monitors the current status of all the applications in the portal.
The application must maintain a special status („dirty“ flag) that tells the portal when there is unsaved data. You can set or reset this status with the setApplicationDirty method of Web Dynpro class WDPortalWorkProtectMode. If the „dirty“ flag is set to the source text WDPortalWorkProtectMode.setApplicationDirty(true);, each navigation step is automatically executed in a separate window. The unsaved data is retained in the original window. In this way the user can change to the original application and save the data.
You can find more information in the SAP Library under:
SAP NetWeaver ® People Integration ® SAP Enterprise Portal Dokumentation ® Administration Guide ® Portal Platform ® Content Administration ® iViews ® Framework API ® New Navigation Model / WorkProtect Mode.
The following source text shows how you can set „dirty“ status:
// Sets “dirty status” to “true”, making the application ”dirty“ // and the application to which you want to navigate is opened in a new // window. The unsaved data is not deleted // from the original window. WDPortalWorkProtectMode.setApplicationDirty(true);
// Sets “dirty status” to “false, making the application “clean”, // that is, there is no more unsaved data. // The application to which you want to navigate is opened in // the same window, and you can leave the original application. WDPortalWorkProtectMode.setApplicationDirty(false);
|
Web Dynpro supports WorkProtect mode in three ways:
·
NONE
With this value, WorkProtect mode is not used by the Web Dynpro application.
If you navigate to another application in the portal, unsaved data is lost,
even if you set the „dirty flag“.
·
APPLICATION_ONLY
With this value, the Web Dynpro application itself decides if there is data
that has not yet been saved, that is if the application is
„dirty“. „Dirty“ status is thus only monitored by the
server. With this value you cannot be sure that the data that was not yet
transferred to the server is lost.
·
STANDARD
With this value the client also checks the „dirty“ status. This
ensures that no user input that was not yet transferred to the server is lost.
This is done by setting the „dirty“ status of the application in
SAP Enterprise Portal as soon as the user has entered data.
The modes mentioned above can be changed as often as needed during runtime of a Web Dynpro application. For example, you can change the mode when a user navigates from one view to another. For one view it could make sense to save data that is entered in an input field. In this case you define the value STANDARD or APPLICATION_ONLY. For another view this security mechanism need not take effect. In this case you define the value NONE.
The following source text shows the different modes that can be defined:
// Defines the different modes. WDPortalWorkProtectMode.setApplicationDirtyControl( WDApplicationIsDirtyMode.NONE);
WDPortalWorkProtectMode.setApplicationDirtyControl( WDApplicationIsDirtyMode.APPLICATION_ONLY);
WDPortalWorkProtectMode.setApplicationDirtyControl( WDApplicationIsDirtyMode.STANDARD);
|
