OracleJavaScript API Reference for Oracle ADF Faces

 

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

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

Warning:

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

public class AdfDhtmlPopupPeer
extends AdfRichUIPeer



Field Summary

private static Object
_DIRTY_STATE_TRACKING_EXPANDO
private static Object
_SHOWN
private static Object
_SYNC_HINTS_LIST


Fields inherited from oracle.adf.view.js.laf.rich.AdfRichUIPeer

addComponentPropertyChanges, addComponentPropertyGetters, BUSY_STYLECLASS, DISABLED_STYLECLASS, DRAG_SOURCE_STYLECLASS, DROP_TARGET_STYLECLASS, FOCUS_TARGET_STYLECLASS, HOVER_TARGET_STYLECLASS, READONLY_STYLECLASS


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

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfDhtmlPopupPeer()


Method Summary

protected Object
BindToComponent(AdfRichPopup component, HTMLElement rootElement)
Binds the component to this peer instance.
public void
cancel(AdfUIComponent component)
Hides the popup and raises the AdfPopupCanceledEvent.
protected void
ComponentPropertyChanged(Object changeEvent)
If the components autoCancel property is AdfRichPopup.AUTO_CANCEL_DISABLED, set a private flag when one of the private hint properties defined by, AdfDhtmlPopupPeer._SYNC_HINTS_LIST has changed.
protected void
ComponentRemoved(AdfUIComponent component)
Removes the content from the popup component.
private static String
_createPagePropertyKey(String clientId)
Replaces all ":" char's with "$".
protected void
DispatchComponentEvent(AdfBaseEvent componentEvent)
Callback event invoked when the content has been delivered.
public boolean
fetchCanceled(AdfUIComponent component)
If the popup is currently fetching content from the server, cancel opening.
public void
fireContentDeliveryNotify(Object hints)
This function raises a AdfContentFetchEvent with the AdfContentFetchEvent.LOADED_EVENT_TYPE event type.
public static HTMLElement
getContentDom(Object component)
Returns the DOM node containing the content of the popup node.
private AdfDhtmlMenuPeer
_getFirstMenuPeer(AdfUIComponent component, Object hints)
Inspects the content of the popup and returns the peer if the first child is a AdfRichMenu component.
protected void
HandleComponentKeyPress(AdfBaseEvent componentEvent)
Intercepts the key press event and invokes a partial submit on the default command if a subform is contained in the content of the popup.
protected void
HandleComponentValueChange(AdfValueChangeEvent componentEvent)
Catch value change events and mark the dom state as dirty if the popup is marked to reset editable values when canceled.
static boolean
__handlePopupCanceled(AdfRichPopup component, HTMLElement contentDom)
Checks the content dom for an indicator that the popup was dismissed by calling on one of the cancel methods.
public void
hide(AdfUIComponent component)
Hides a client popup component and removes the content if the content delivery is CONTENT_DELIVERY_LAZY_UNCACHED.
private static void
_initPrivateProperties(Object component)
If autoCancel=disabled, the private properties that hold popup hints are initialized.
protected static Object
InitSubclass()
private static boolean
_isAutoCancel(Object component)
private static boolean
_isResetEditableValuesWhenCanceled(AdfRichPopup component)
private static boolean
_isRestoreEnabled(AdfRichPopup component, HTMLElement contentDom)
Checks for an expando added to the contentDom if the popup was canceled due to a dom replacement and the component has disabled auto cancel via the "autoCancel=disabled" component property.
public boolean
isVisible(AdfUIComponent component)
Returns true if popup is visible.
protected void
PopupClosed(AdfUIComponent component, HTMLElement contentDom)
Fires the "popupClosed" on the component after moving the contentDom back under the popupDom.
protected void
PopupOpened(AdfUIComponent component)
Callback handler that is invoked after the popup becomes visible.
protected void
ReplaceDomElement(HTMLElement newElement, HTMLElement oldElement)
Replaces the a dom element contained in this peer.
private void
_resetContentDelivery(AdfUIComponent component)
private void
_restorePopup(Object component)
Finds the popup hints cached as page properties and invokes the show method passing the hints.
public static void
setChildHints(AdfUIComponent popupComponent, Object hints)
Provides popup hit overrides that are merged into the hints provided as the actaul parameter fo the show method.
private void
_setShown(AdfUIComponent component, boolean shown, boolean suppressSyncEvent)
Sets a property on the component that is prorogated to the server indicating the client component is shown.
public void
show(AdfUIComponent component, Object hints)
Shows the content of the popup component using the supplied hints.
private void
_showPopup(AdfUIComponent component, Object hints)
Inspects the content of the popup looking for a menu as the first child.
public void
syncPrivateProperties(Object component, map hints, boolean suppressSyncEvent)
Saves a map of popup hints to private component properties that are synchronized with the server.
private Number
_visitChildrenForMenu(AdfUIComponent component)
Callback used by _getFirstMenuPeer to visitChildren on the component.


Methods inherited from oracle.adf.view.js.laf.rich.AdfRichUIPeer

addComponentEventHandlers, addComponentPropertyChanges, addComponentPropertyGetters, addDomEventHandlers, addEventHandlerToDomInstance, addSuppressedPPRAttributes, bind, cancelAllPopups, cancelPopup, ChildVisibilityChanged, ComponentInlineStyleChanged, componentRemoved, ComponentStyleClassChanged, ComponentVisibleChanged, ConvertClientIdToLocator, convertLocatorToClientId, CreateDraggableNode, createPeerClass, createSubId, CreateSubId, DefaultInitClass, descendantMessageChanged, DescendantMessageChanged, domReplaceNotify, DomReplaceNotify, focus, Focus, getAbsoluteId, getAbsoluteLocator, getAccessibleName, GetAccessibleName, getAllPopups, getComponent, GetComponent, GetComponentId, getComponentParent, getComponentProperty, GetComponentVisible, getDescendantComponents, getDomContentElement, getDomContentElementForComponent, GetDomContentElementForNode, getDomDocument, getDomElement, getDomElementForComponent, getDomNode, GetDomNodeForCommentComponent, getDomNodeForComponent, getDragOverFeedback, GetDragOverFeedback, getDragTransferable, GetDragTransferable, getFirstAncestorComponent, getInlineEditor, GetInlineEditor, getInlineStyleProperty, getLocatorByDomElement, getPagePosition, getPopupWindow, getReadyState, GetReadyState, GetRichResourceURL, getSubIdDomElement, GetSubIdDomElement, hideAllPopups, hidePopup, Init, InitClass, InitDomElement, initialize, isActive, isInActiveHeirarchy, isPopupVisible, messageNotify, MessageNotify, messageShow, MessageShow, needsChildVisibilityChanges, needsFocusTargetStyleClass, processPushData, ProcessPushData, registerKeyStroke, replaceDomElement, resizeNotify, ResizeNotify, scrollIntoView, ScrollIntoView, setBusy, SetBusy, setInlineStyleProperty, showContextMenu, showPopup, TruncateClientId, TruncateClientIdOnceImpl, UnbindFromComponent, unregisterKeyStroke, visitChildren


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

getDefaultDragRecognizer, getParentPeer, initiateDrag, needsResizeNotify


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

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


Field Detail


_DIRTY_STATE_TRACKING_EXPANDO

private static Object _DIRTY_STATE_TRACKING_EXPANDO

_SHOWN

private static Object _SHOWN

_SYNC_HINTS_LIST

private static Object _SYNC_HINTS_LIST

Constructor Detail


AdfDhtmlPopupPeer

public AdfDhtmlPopupPeer()

Method Detail


BindToComponent

protected Object BindToComponent(AdfRichPopup component,
                                 HTMLElement rootElement)

Binds the component to this peer instance.

Parameters:
component  -  the component to bind
rootElement  -  the root DOM element of this peer
Return:
Object
Overrides:
AdfRichUIPeer.BindToComponent(Object, Object)

cancel

public void cancel(AdfUIComponent component)

Hides the popup and raises the AdfPopupCanceledEvent. This event will propagate to the server if there are registered server-side listeners. We also remove the content if the content delivery is CONTENT_DELIVERY_LAZY_UNCACHED.

Parameters:
component  -  target getting dismissed
Return:
void - null

ComponentPropertyChanged

protected void ComponentPropertyChanged(Object changeEvent)

If the components autoCancel property is AdfRichPopup.AUTO_CANCEL_DISABLED, set a private flag when one of the private hint properties defined by, AdfDhtmlPopupPeer._SYNC_HINTS_LIST has changed. The flag is used to determine if a (AdfContentFetchEvent.SYNC_EVENT_TYPE) should be queued.

Parameters:
changeEvent    
Return:
void - null
See also:
syncPrivateProperties(Object, map, boolean)
_setShown(AdfUIComponent, boolean, boolean)
Overrides:
AdfUIPeer.ComponentPropertyChanged(Object)

ComponentRemoved

protected void ComponentRemoved(AdfUIComponent component)

Removes the content from the popup component.

Parameters:
component  -  popup
Return:
void - null
Overrides:
AdfUIPeer.componentRemoved(AdfUIComponent)

_createPagePropertyKey

private static String _createPagePropertyKey(String clientId)

Replaces all ":" char's with "$".

Parameters:
clientId  -  of the popup component
Return:
String - map safe key

DispatchComponentEvent

protected void DispatchComponentEvent(AdfBaseEvent componentEvent)

Callback event invoked when the content has been delivered.

Parameters:
componentEvent  -  content fetch event requesting content reload
Return:
void - null
Overrides:
AdfUIPeer.DispatchComponentEvent(Object)

fetchCanceled

public boolean fetchCanceled(AdfUIComponent component)

If the popup is currently fetching content from the server, cancel opening.

Parameters:
component  -  popup component
Return:
boolean - true if the component is currently fetching content from the server

fireContentDeliveryNotify

public void fireContentDeliveryNotify(Object hints)

This function raises a AdfContentFetchEvent with the AdfContentFetchEvent.LOADED_EVENT_TYPE event type. This act completes the dynamic content delivery of the popup. The same event is raised in DispatchComponentEvent but with a AdfContentFetchEvent.FETCH_EVENT_TYPE. This function will be called by the server-side renderer in response to the fetch. The event has to be queued using script versus the DomReplaceNotify that is called when a partial fragment is replaced. The popup might have a parent that is folded into the same PPR request. In this case, the parent will render it's children including the popup and the content notify will be fired on the parent peer.

Parameters:
hints    
Return:
void - null

getContentDom

public static HTMLElement getContentDom(Object component)

Returns the DOM node containing the content of the popup node. The node is returned by sub client id.

Parameters:
component    
Return:
HTMLElement - content dom node

_getFirstMenuPeer

private AdfDhtmlMenuPeer _getFirstMenuPeer(AdfUIComponent component,
                                                Object hints)

Inspects the content of the popup and returns the peer if the first child is a AdfRichMenu component. If hints are given and the HINT_TYPE_MENU is not given, the content is not inspected.

Parameters:
component  -  root popup component
hints  -  popup hints
Default value = null
Return:
AdfDhtmlMenuPeer - menu peer if the first child is a AdfRichMenu

HandleComponentKeyPress

protected void HandleComponentKeyPress(AdfBaseEvent componentEvent)

Intercepts the key press event and invokes a partial submit on the default command if a subform is contained in the content of the popup.

Parameters:
componentEvent  -  key stroke event
Return:
void - null

HandleComponentValueChange

protected void HandleComponentValueChange(AdfValueChangeEvent componentEvent)

Catch value change events and mark the dom state as dirty if the popup is marked to reset editable values when canceled.

Parameters:
componentEvent  -  value change event
Return:
void - null

__handlePopupCanceled

static boolean __handlePopupCanceled(AdfRichPopup component,
                                      HTMLElement contentDom)

Checks the content dom for an indicator that the popup was dismissed by calling on one of the cancel methods. The contentDom is not reparented here. It is only needed to check for the indicator. For the context menu, it will be the menu's content dom not the popup's content. The AdfPopupCanceledEvent is queued if closed in a cancel status. This event will conditionally propragate to the server depending on if there are any server-side listeners attached to the popup component.

Parameters:
component  -  dismissed popup
contentDom  -  content dom that was reparented when the popup was shown
Return:
boolean - true if a canceled event was raised the propagates to server

hide

public void hide(AdfUIComponent component)

Hides a client popup component and removes the content if the content delivery is CONTENT_DELIVERY_LAZY_UNCACHED.

Parameters:
component  -  target being hidden
Return:
void - null

_initPrivateProperties

private static void _initPrivateProperties(Object component)

If autoCancel=disabled, the private properties that hold popup hints are initialized. The private properties are unknown and do not cause the popup to be auto PPRed.

Parameters:
component    
Return:
void - null

InitSubclass

protected static Object InitSubclass()

Return:
Object

_isAutoCancel

private static boolean _isAutoCancel(Object component)

Parameters:
component    
Return:
boolean - true if the autoCancel equals AdfRichPopup.AUTO_CANCEL_ENABLED

_isResetEditableValuesWhenCanceled

private static boolean _isResetEditableValuesWhenCanceled(AdfRichPopup component)

Parameters:
component  -  the component to bind
Return:
boolean - null true if the resetEditableValues is AdfRichPopup.RESET_EDITABLE_VALUES_WHEN_CANCELED or has popupCanceledListener(s) registered to the component.

_isRestoreEnabled

private static boolean _isRestoreEnabled(AdfRichPopup component,
                                         HTMLElement contentDom)

Checks for an expando added to the contentDom if the popup was canceled due to a dom replacement and the component has disabled auto cancel via the "autoCancel=disabled" component property.

Parameters:
component  -  dismissed popup
contentDom  -  content dom that was reparented when the popup was shown
Return:
boolean - true if the popup should be restored

isVisible

public boolean isVisible(AdfUIComponent component)

Returns true if popup is visible.

Parameters:
component  -  target being checked
Return:
boolean - true if the component is visible
Overrides:
AdfUIPeer.isVisible()

PopupClosed

protected void PopupClosed(AdfUIComponent component,
                           HTMLElement contentDom)

Fires the "popupClosed" on the component after moving the contentDom back under the popupDom. The act of moving the dom subtree hides the markup under a hidden div. When the popup is used with the context menu, the contentDom parameter will be null. The menu handles reparenting the dom used by the floating element versus using the "::content" marker of the popup's content.

Parameters:
component  -  target being closed
contentDom  -  content shown in the popup
Default value = null
Return:
void - null
See also:
AdfDhtmlMenuPeer.PopupClosed(Object, Object, Object)
Overrides:
AdfRichUIPeer.PopupClosed(AdfUIComponent, HTMLElement, String)

PopupOpened

protected void PopupOpened(AdfUIComponent component)

Callback handler that is invoked after the popup becomes visible. The visibility is conditionally controlled in a timed event. The "popupOpened" event needs to be fired after visible so that the focus can be controlled. This event can not be canceled. The "shown" status is set by calling _setShown prior to raising the AdfPopupOpenEvent.

Parameters:
component  -  source of the AdfPopupOpenedEvent
Return:
void - null

ReplaceDomElement

protected void ReplaceDomElement(HTMLElement newElement,
                                 HTMLElement oldElement)

Replaces the a dom element contained in this peer. Special handling of the content dom if the resetEditableValues is AdfRichPopup.RESET_EDITABLE_VALUES_WHEN_CANCELED. Remove dirty state tracking from the old content dom and establish tracking on the new dom.

Parameters:
newElement  -  the new dom element
oldElement  -  the old dom element
Return:
void - null
Overrides:
AdfRichUIPeer.replaceDomElement(AdfUIComponent, HTMLElement, HTMLElement)

_resetContentDelivery

private void _resetContentDelivery(AdfUIComponent component)

Parameters:
component  -  to reset content delivery
Return:
void - null

_restorePopup

private void _restorePopup(Object component)

Finds the popup hints cached as page properties and invokes the show method passing the hints. This could be called from a queued AdfContentFetchEvent.LOADED_EVENT_TYPE or directly when the popup is restored, autoCancel="disabled".

Parameters:
component    
Return:
void - null
See also:
DispatchComponentEvent(AdfBaseEvent)
fireContentDeliveryNotify(Object)

setChildHints

public static void setChildHints(AdfUIComponent popupComponent,
                                 Object hints)

Provides popup hit overrides that are merged into the hints provided as the actaul parameter fo the show method.

Parameters:
popupComponent  -  target hints assignee
hints  -  additional hints used by the component when show is invoked
Default value = null
Return:
void - null

_setShown

private void _setShown(AdfUIComponent component,
                       boolean shown,
                       boolean suppressSyncEvent)

Sets a property on the component that is prorogated to the server indicating the client component is shown. In order to force these private properties to propagates to the server, an AdfContentFetchEvent.SYNC_EVENT_TYPE is raised under certian conditions. We queue the sync event if not suppressing, the properties value changed and autoCancel=disabled.

Parameters:
component  -  target being shown or hidden
shown  -  boolean flag indicating visible state
suppressSyncEvent  -  false if a property sync event is needed
Return:
void - null

show

public void show(AdfUIComponent component,
                 Object hints)

Shows the content of the popup component using the supplied hints. If the component is already visbile, the function is returned. If the component requires lazy content delivery, the event is queued and this method will be invoked again from the "DispatchComponentEvent" method. This peer makes sure that the "popupOpening" event is fired. If the AdfPopupOpeningEvent is not canceled, the popup is show and the shown status sent to the server. This method hooks-up the PopupOpened callback handler that is invoked after the popup becomes visible.

Parameters:
component  -  popup component
hints  -  parameters setting behaviors
Default value = null
Return:
void - null

_showPopup

private void _showPopup(AdfUIComponent component,
                        Object hints)

Inspects the content of the popup looking for a menu as the first child. If a menu exists, invoke the menus peer; otherwise, invoke the standard popup logic in the base peer. The popup hits are merged with _childHints before invoker either peer.

Parameters:
component  -  target popup component
hints    
Return:
void - null

syncPrivateProperties

public void syncPrivateProperties(Object component,
                                  map hints,
                                  boolean suppressSyncEvent)

Saves a map of popup hints to private component properties that are synchronized with the server. Only a subset of hints are eligible for popup restoration and only if autoCancel=disabled. These are all private unknown properties so they will automatically supress PPR of the component on value change. In order to force these private properties to propagates to the server, an AdfContentFetchEvent.SYNC_EVENT_TYPE is raised if we detect a property change on any of these private properties.

Parameters:
component    
hints  -  to be sent to the server.
Default value = null
suppressSyncEvent  -  if true, do not fire a sync event even if there is a property change detected
Default value = undefined
Return:
void - null
See also:
ComponentPropertyChanged(Object)

_visitChildrenForMenu

private Number _visitChildrenForMenu(AdfUIComponent component)

Callback used by _getFirstMenuPeer to visitChildren on the component. The callback looks at the first child to see if it is a AdfRichMenu. If the first child is a menu, it is assigned to a temporary private variable. If the child is an AdfRichRegion, the search continues

Parameters:
component  -  child component visited
Return:
Number - returns a value of 2 if traversal has finished, 0 if traversal needs to continue

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

 

Generated on 2011.08.31 02:41 UTC
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.