oracle.adf.view.rich.context

## Class DirtyPageHandler

- java.lang.Object
- - oracle.adf.view.rich.context.DirtyPageHandler

-     @Exported
      public abstract class DirtyPageHandler
      extends Object

  META_INF/services-based application-scoped object for tracking whether navigation will result in data loss. Only a single implementation may be registered per application. Registering multiple implementations will result in an IllegalStateException at applciation initialization. If no implementation is registered, a default implementation will be used. That implementation will always return `false` from `isDataDirty` and will do nothing in response to a `trackNavigation` call.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DirtyPageHandler.DirtyPageContext` Context class passed to the DirtyPageHandler's `trackNavigation` when DirtyPageHandler needs to track navigation and call `confirmNavigation` when a navigation will result in the loss of uncommitted data
    `static class` | `DirtyPageHandler.UncommittedDataWarning` Possible Uncommitted Data warning configuration options

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirtyPageHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DirtyPageHandler.UncommittedDataWarning` | `getUncommittedDataWarning()` Returns a default value for the Uncommitted Data Warning configuration option
    `boolean` | `isDataDirty()` Called by the view during the RenderResponse phase to determine whether the page being rendered contains uncommitted data.
    `void` | `navigationCanceled(String confirmationToken)` Called by the view when the user has canceled a navigation that could result in data loss.
    `void` | `navigationConfirmed(String confirmationToken)` Called by the view when the user has confirmed a navigation that could result in data loss.
    `void` | `trackNavigation(DirtyPageHandler.DirtyPageContext dirtyContext)` Called by the view once per request before the InvokeApplication phase to indicate whether the DirtyHandler should track navigation for this request.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DirtyPageHandler

          public DirtyPageHandler()

  - ### Method Detail

    - #### getUncommittedDataWarning

          public DirtyPageHandler.UncommittedDataWarning getUncommittedDataWarning()

      Returns a default value for the Uncommitted Data Warning configuration option
      Returns:
        configuration option

    - #### isDataDirty

          public boolean isDataDirty()

      Called by the view during the RenderResponse phase to determine whether the page being rendered contains uncommitted data. If it does, the view may warn the user if the user attempts to navigate off of the current page.
      Returns:
        `true` if the current page contains uncommitted data.

    - #### trackNavigation

          public void trackNavigation(DirtyPageHandler.DirtyPageContext dirtyContext)

      Called by the view once per request before the InvokeApplication phase to indicate whether the DirtyHandler should track navigation for this request. If `dirtyContext` is non-null, navigation should be tracked and `DirtyPageContext.confirmNavigation` should be called when a navigation is going to result in the loss of uncommitted data.
      Parameters:
        `dirtyContext` - the dirty context.
      See Also:
        `DirtyPageHandler.DirtyPageContext`

    - #### navigationConfirmed

          public void navigationConfirmed(String confirmationToken)

      Called by the view when the user has confirmed a navigation that could result in data loss. The confirmationToken previously returned by the DirtyPageHandler is passed in so that the DiryPageHandler can restore any necessary state. The DirtyPageHandler is expected to proceed with the operation that caused the DirtyPageHandler to initially call `DirtyPageContext.confirmNavigation`.
      Parameters:
        `confirmationToken` - the confirmation token.
      See Also:
        `DirtyPageHandler.DirtyPageContext.confirmNavigation(java.lang.String)`

    - #### navigationCanceled

          public void navigationCanceled(String confirmationToken)

      Called by the view when the user has canceled a navigation that could result in data loss. The confirmationToken previously returned by the DirtyPageHandler is passed in so that the DiryPageHandler can clean up any saved state.
      Parameters:
        `confirmationToken` - the confirmation token.
      See Also:
        `DirtyPageHandler.DirtyPageContext.confirmNavigation(java.lang.String)`

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.