OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.laf.dhtml.rich
Class AdfDirtyStateService

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfDirtyStateService

public class AdfDirtyStateService
extends AdfObject
Class responsible for tracking the dirty state of input components on the page. This tracks both ADF components as well as 3rd party components using form input elements.



Field Summary

private static Object
_AUTO_GEN_PREFIX
private Object
_dirtyComponentIds
private Object
_dirtyDataComponents
private Object
_dirtyFormElements
private static Object
_FORM_ID_EXPANDO
private Object
_nextFormElementCounter
private Object
_origFormValues
private Object
_potentiallyHasDirtyComponents
private Object
_potentiallyHasDirtyFormValues


Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfDirtyStateService(AdfDhtmlPage page)
Class responsible for tracking the dirty state of input components on the page.


Method Summary

Object
__alwaysDisplayDirtyDataWarning()
private Object
_componentHasDirtyFormData(Object clientId)
Object
__dataCommitted(Array.<String> ids, boolean immediateOnly)
Notifies the dirty state that dirty values have been processed on the server and do not need to be sent again.
private Object
_gatherDescedantComponents(Object components)
public Array.<AdfUIComponent>
getDirtyComponents(AdfUIComponent= ancestor)
Obtain a list of the components that are dirty, optionally filtering by hierarchy.
private Object
_getFormElement(Object id)
private string|null
_getFormElementName(Node node)
Gets the form element name of a node.
private Object
_getFormIdentifier(Object formElement)
private Object
_handleBlurEvent(AdfComponentEvent componentEvent)
Called from AdfDhtmlPage when a blur event has been captured.
private Object
_handleComponentRemovedEvent(Object componentEvent)
private Object
_handleFocusEvent(AdfComponentEvent componentEvent)
Called from AdfDhtmlPage when a focus event has been captured.
Object
__handleValueChangeEvent(AdfValueChangeEvent componentEvent)
Called from AdfDhtmlPage when an AdfValueChangeEvent is queued.
public boolean
hasDirtyData(AdfUIComponent=|Node ancestor)
Check if the component is dirty or if there are dirty components or form elements below a given component.
protected Object
Init(Object page)
Initializes the instance.
protected static Object
InitClass()
private Object
_initPotentiallyDirtyFlags()
public boolean
isDirty(AdfUIEditableValue|string inputComponent)
Check if a client component has data that has not been updated on the server.
private Object
_isImmediateEditableValueComponent(Object clientId)
private boolean
_isInputComponentElement(AdfUICoponent component, Element formElement)
Check if a form element belongs to an input component element.
Object
__isInputValueDirty(Object page, Object component, Object inputElement)
public Object
isNamingContainerDirty(string clientId)
Performs an optimized search compared to hasDirtyData to search for dirty data underneath a naming container component using its client ID.
Object
__isPotentiallyDirty()
Method to check if a dirty check is necessary (if any data on the page may be dirty)
private Object
_needsSpuriousDirtyValueTracking(Object page)
Tests whether the dirty state service should enable "spurious" dirty value tracking.
Object
__registerDirtyDataComponent(Object component, Object level)
private Object
_resetSpuriousDirtyValue(Object clientId)
Resets a single spurious dirty value.
private Object
_resetSpuriousDirtyValues(Object page, Object dirtyComponentIds)
Resets spurious dirty values for all components specified in the dirtyComponentIds collection, if _needsSpuriousDirtyValueTracking() is true.
Object
__resetState()
Clears all the data for tracking dirty state.
public Object
setDirty(string clientId, boolean dirty)
Marks the specified client id as dirty for the purposes of uncomitted data warning and dirty postback payload tracking.


Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, exportPrototypeSymbol, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString


Field Detail


_AUTO_GEN_PREFIX

private static Object _AUTO_GEN_PREFIX

_dirtyComponentIds

private Object _dirtyComponentIds

_dirtyDataComponents

private Object _dirtyDataComponents

_dirtyFormElements

private Object _dirtyFormElements

_FORM_ID_EXPANDO

private static Object _FORM_ID_EXPANDO

_nextFormElementCounter

private Object _nextFormElementCounter

_origFormValues

private Object _origFormValues

_potentiallyHasDirtyComponents

private Object _potentiallyHasDirtyComponents

_potentiallyHasDirtyFormValues

private Object _potentiallyHasDirtyFormValues

Constructor Detail


AdfDirtyStateService

public AdfDirtyStateService(AdfDhtmlPage page)

Class responsible for tracking the dirty state of input components on the page. This tracks both ADF components as well as 3rd party components using form input elements.

Parameters:
page  -  the page

Method Detail


__alwaysDisplayDirtyDataWarning

Object __alwaysDisplayDirtyDataWarning()

Return:
Object

_componentHasDirtyFormData

private Object _componentHasDirtyFormData(Object clientId)

Parameters:
clientId    
Return:
Object

__dataCommitted

Object __dataCommitted(Array.<String> ids,
                        boolean immediateOnly)

Notifies the dirty state that dirty values have been processed on the server and do not need to be sent again.

Parameters:
ids  -  array of IDs that were processed on the server
immediateOnly  -  true if only immediate input components were processed
Return:
Object

_gatherDescedantComponents

private Object _gatherDescedantComponents(Object components)

Parameters:
components    
Return:
Object

getDirtyComponents

public Array.<AdfUIComponent> getDirtyComponents(AdfUIComponent= ancestor)

Obtain a list of the components that are dirty, optionally filtering by hierarchy.

Parameters:
ancestor  -  optional client component to use to filter the results. If present, only descendents of the component will be returned
Return:
Array.<AdfUIComponent> - array of all the components that are dirty, optionally filtered by the ancestor

_getFormElement

private Object _getFormElement(Object id)

Parameters:
id    
Return:
Object

_getFormElementName

private string|null _getFormElementName(Node node)

Gets the form element name of a node.

Parameters:
node  -  the node to check
Return:
string|null - the form element name if the node is a form element and the name attribute is set.

_getFormIdentifier

private Object _getFormIdentifier(Object formElement)

Parameters:
formElement    
Return:
Object

_handleBlurEvent

private Object _handleBlurEvent(AdfComponentEvent componentEvent)

Called from AdfDhtmlPage when a blur event has been captured.

Parameters:
componentEvent  -  the blur component event
Return:
Object

_handleComponentRemovedEvent

private Object _handleComponentRemovedEvent(Object componentEvent)

Parameters:
componentEvent    
Return:
Object

_handleFocusEvent

private Object _handleFocusEvent(AdfComponentEvent componentEvent)

Called from AdfDhtmlPage when a focus event has been captured.

Parameters:
componentEvent  -  the focus component event
Return:
Object

__handleValueChangeEvent

Object __handleValueChangeEvent(AdfValueChangeEvent componentEvent)

Called from AdfDhtmlPage when an AdfValueChangeEvent is queued.

Parameters:
componentEvent  -  the value change event being queued on the page.
Return:
Object

hasDirtyData

public boolean hasDirtyData(AdfUIComponent=|Node ancestor)

Check if the component is dirty or if there are dirty components or form elements below a given component.

Parameters:
ancestor  -  optional client component or DOM node to use to check below. If not given the function checks the entire page, otherwise it will check if any form elements or client components are dirty that are descendents of the given component.
Return:
boolean - true if the component is dirty or any descendent of the component.

Init

protected Object Init(Object page)

Initializes the instance. Subclasses of AdfObject must call their superclass' Init

Parameters:
page    
Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Return:
Object

_initPotentiallyDirtyFlags

private Object _initPotentiallyDirtyFlags()

Return:
Object

isDirty

public boolean isDirty(AdfUIEditableValue|string inputComponent)

Check if a client component has data that has not been updated on the server.

Parameters:
inputComponent  -  the input component to check if it contains dirty data. The client ID of a component is also an accepted argument.
Return:
boolean - true if the input component has dirty data

_isImmediateEditableValueComponent

private Object _isImmediateEditableValueComponent(Object clientId)

Parameters:
clientId    
Return:
Object

_isInputComponentElement

private boolean _isInputComponentElement(AdfUICoponent component,
                                         Element formElement)

Check if a form element belongs to an input component element.

Parameters:
component  -  the closest ancestor component
formElement  -  the node to check
Return:
boolean - true if it is part of an input component

__isInputValueDirty

Object __isInputValueDirty(Object page,
                            Object component,
                            Object inputElement)

Parameters:
page    
component    
inputElement    
Return:
Object

isNamingContainerDirty

public Object isNamingContainerDirty(string clientId)

Performs an optimized search compared to hasDirtyData to search for dirty data underneath a naming container component using its client ID.

Parameters:
clientId  -  the client ID of the naming container component
Return:
Object
See also:
hasDirtyData(AdfUIComponent=|Node)

__isPotentiallyDirty

Object __isPotentiallyDirty()

Method to check if a dirty check is necessary (if any data on the page may be dirty)

Return:
Object

_needsSpuriousDirtyValueTracking

private Object _needsSpuriousDirtyValueTracking(Object page)

Tests whether the dirty state service should enable "spurious" dirty value tracking. Normally, the dirty state service relies on DOM events (eg. focus, blur) and ADF component events (eg. AdfValueChangeEvents) to determine whether an input component is dirty. This event-driven approach assumes that these events will actually be delivered when the user modifies each editable value. Unfortunately, this assumption does not hold up when running under Selenium RC. Selenium RC has a bad habit of dropping DOM events (eg. focus, blur, change). This can lead to a failure to deliver AdfValueChangeEvents as well as a failure to detect dirtied components. When dirty postbacks are enabled, these missing events can lead to a the omission of dirty values from the postback payload, which can easily result in test failures. To help work around these Selenium RC-specific failures, the dirty state service facilitates another mechanism for detecting dirty values. Rather than rely entirely on proper DOM/component event delivery, the dirty state service can also ask the peer whether it considers itself to be dirty. This check is done by calling __isSpuriousDirtyValue() on the peer. In some cases, peer implementations of __isSpuriousDirtyValue() may require access to some stored state (eg. the peer's initial value). In order to allow for clean up of this state, the dirty state service also calls __resetSpuriousDirtyValue() on the peer to let it know that a previously reported "spurious" dirty value has been processed by the server. Since this spurious dirty value tracking mecahnism does add some overhead, rather than always enabling this feature, it is only enabled when we detect that a) dirty postbacks are enabled and b) we are running inside of Selenium RC.

Parameters:
page    
Return:
Object

__registerDirtyDataComponent

Object __registerDirtyDataComponent(Object component,
                                     Object level)

Parameters:
component    
level    
Return:
Object
See also:
AdfDhtmlPage.registerDirtyDataComponent(AdfUIComponent, Object)

_resetSpuriousDirtyValue

private Object _resetSpuriousDirtyValue(Object clientId)

Resets a single spurious dirty value. Note that unlike _resetSpuriousDirtyValues(), this method assumes that the caller has already verified that _needsSpuriousDirtyValueTracking() is true.

Parameters:
clientId    
Return:
Object

_resetSpuriousDirtyValues

private Object _resetSpuriousDirtyValues(Object page,
                                         Object dirtyComponentIds)

Resets spurious dirty values for all components specified in the dirtyComponentIds collection, if _needsSpuriousDirtyValueTracking() is true.

Parameters:
page    
dirtyComponentIds    
Return:
Object

__resetState

Object __resetState()

Clears all the data for tracking dirty state. Resets everything to be "clean".

Return:
Object

setDirty

public Object setDirty(string clientId,
                       boolean dirty)

Marks the specified client id as dirty for the purposes of uncomitted data warning and dirty postback payload tracking. Note that we are temporarily exposing this package-private method for one reason only - to work around a Selenium bug where Selenium:
  1. Fails to deliver a blur event. And...
  2. Instead delivers a bonus focus event.
When this happens, AdfDhtmlInputBasePeer's last value tracking is hosed, and we lose track of the fact that the input value has been modified. For the moment, we work around this by allowing AdfDhtmlInputBasePeer to notify us when it detects this scenario.

Parameters:
clientId  -  the ID of the client component to be marked as dirty.
dirty  -  if true, will mark the component as dirty, false to mark the component as not being dirty
Return:
Object

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2014.03.27 12:59 UTC
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.