Show TOC

Using WorkProtect ModeLocate this document in the navigation structure

Use

To avoid losing unsaved data when navigating to another iView, the portal provides a WorkProtect mode that, when activated, provides the user an opportunity to save any changes before navigating.

Setting WorkProtect Mode

You can turn WorkProtect mode on and off for your application, and also set the type of WorkProtect mode, by calling the WDPortalWorkProtectMode.setApplicationDirtyControl() method.

There are three settings for WorkProtect mode:

  • None: WorkProtect mode is off.

  • Application Only (default): Only the application determines the dirty state, that is, whether there is unsaved data. With this setting, the dirty state is only defined on the server side, so data that is not transported to the server may still be lost.

  • Standard: The application and the Web Dynpro browser client both check the application state. The Web Dynpro browser client makes sure that no user input data that is typed into the user interface is lost, by setting the dirty state as soon as the user makes an input.

The following is an example of setting the mode to standard:

               WDPortalWorkProtectMode.setApplicationDirtyControl( 
    WDApplicationIsDirtyMode.STANDARD); 

            

Indicating that Data Has Changed (Dirty State)

The application can indicate that there is unsaved data by calling WDPortalWorkProtectMode.setApplicationDirty() method, as shown in the following example:

               WDPortalWorkProtectMode.setApplicationDirty(true); 

            
Note

WorkProtect mode is only available for applications that run in the Web Dynpro browser client.