OracleJavaScript API Reference for Oracle ADF Faces

 

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

oracle.adfinternal.view.js.laf.dhtml.internalWindow
Class AdfDhtmlPopupWindow

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.laf.dhtml.internalWindow.AdfAbstractFloatingElement
               |
               +--oracle.adfinternal.view.js.laf.dhtml.internalWindow.AdfDhtmlPopupWindow
Direct Known Subclasses:
AdfDhtmlPopupLayer, AdfDhtmlPopupMenu, AdfDhtmlPopupSelector, AdfDhtmlSimpleFloat

public class AdfDhtmlPopupWindow
extends AdfAbstractFloatingElement



Field Summary

private static Object
_ANIMATE_WRAPPER_EXPANDO
 static Object
__CANCELED_EXPANDO
Holds the name of the expando property added to the contentDom of the AdfDhtmlPopupHints.CLOSE_HANDLER_PARAM when the floating element is dismissed by calling cancel.
private Object
_isTouchScreen
 static Object
__POPUPID_EXPANDO
 static Object
__REPLACEDOM_EXPANDO
private static Object
_SCROLL_POSITION_EXPANDO
public Object
setElement


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

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfDhtmlPopupWindow()


Method Summary

public Object
addOpenedHandler(function handler, object params)
protected Object
AnimateOpening(Object animationDuration, Object hints)
Animates the opening of the popup.
protected Object
AnimateUsingWrapper(Number animationDuration, Object isAchorRight, Object isAchorBottom, Object hints)
Removes the managed dom element replacing with a hidden div.
protected static Object
AnimationComplete(Object context)
Callback invoked after open animation has completed.
private Object
_announce(String messageKey)
Announces a popup status change to assistive technologies.
public Object
autoSize()
Updates the size of the popup to match its content and resizes the shadow decorator.
public Object
cancel(boolean replaceDom)
Dismisses the floating element indicating an awkward state or unexpected state.
protected HTMLElement
CreateDomElement()
Create and initialize the html.
private static String
_createFocusPagePropertyKey(String clientId)
Generates a key based on the popup's client id by replacing all ":" char's with "$" and then adding a sufix of "$restoreFocus".
protected Object
CreateShadow(Boolean afterAnimation)
Creates the shadow for this popup window.
private Object
_delayedCheckedFocus(Object params)
Callback for setting focus with a check to see if the element is focusable and the focus element is outside of the popup element, and there is not currently a focusasble element in focus.
public Object
destroy()
Unregister event handlers, remove the shadow decorator, unregister with the position manager before calling on super.
protected Object
DoResizeNotifyDom(Object content)
Perform a resize notification traversal when showing popup contents so that geometry managing components are given the opportunity to lay themselves out.
protected Object
DoShow(Object hints)
Do the work to actually display of the popup window.
protected Object
FocusOnFirstElement()
Sets focus to the first content element in the window.
protected String
GetAnimateSkinProperty()
protected Number
GetAnimationDuration()
protected String
GetAnimationDurationSkinProperty(Object hints)
public HTMLElement
getContent()
protected HTMLElement
GetContentParent()
Gets the dom element that is the parent of the popup's content.
protected HTMLElement
GetFocusContent()
Returns the content dom node for the popup.
protected Boolean
GetFocusOnOpen()
private static String
_getFormElementId(HtmlElement node)
Returns the form element id for a given dom node.
protected Object
GetLaunchSourceElement()
Get the launch source element (if available).
public String
getLaunchSourceId()
Returns the clientId of the launching source if provided using the AdfRichPopup.HINT_LAUNCH_ID popup hint.
protected int
GetMaxWidth()
public String
getPopupClientId()
This getter exposes a popup hint that captures the popups's clientId.
protected Number
GetPositionManagerIndex()
public int
getZorderScope()
Returns the scope that the popup was created.
protected Object
HandleEscapeKey(Object event)
Overridable function to handle escape key.
private Object
_handleKeyDown(Event event)
Handles the keydown event from the document.
protected Object
HandleKeyNavigation(Object event)
Overridable function to handle ctr+alt+w window navigation.
private Object
_handleKeyUp(Object event)
Handles the keyup event from the document.
private Object
_handleResize()
Callback invoked every time the size of the floating element changes.
protected Object
HasShadow()
public Object
hide()
Hides this popup window.
protected boolean
ImmediateZorderRegistration()
Determines if the target element should be registered immediately with the zorder manager upon its mutator getting called.
protected Object
Init()
Initializes the instance.
protected static Object
InitClass()
public static boolean
isAncestorOrSelf(Node ancestorNode, Node domElement)
Checks to see if the "ancestorNode" is a ancestor of "node" or if they are the same.
public Object
isAnimating()
Returns if the popup window is currently animating during the opening of the window.
private boolean
_isRestoring(AdfRichPopup component)
Used to determine if the popup should restore focus when closed.
public Boolean
isVisible()
protected void
OpenedPopup()
Invokes the opened handler callback.
protected Object
Position(String hintAlign)
Registers this floating element with the position manager based on the alignment hint.
private Object
_positionAtMousePointer(Object pos)
Registers this floating element with the position manager based on a mouse x,y position.
private Object
_registerEventHandlers()
Registers listeners with the document.
private Object
_restoreFocus()
Restore the keyboard focus to its previous location
private static Object
_restoreRootPostAnimation(Object wrapper)
Restores the dom element after animation has completed.
protected Object
RestoreScrollValues(HTMLElement domElement)
Finds all child DOM elements that need their vertical scroll values restored and restores them.
protected Object
SaveScrollValues(HTMLElement domElement)
Finds all child DOM elements that have scroll values and saves their scroll value information.
public Object
setCloseHandler(Function handler)
Sets the Handler invoked when the selector is being dismissed
public Object
setCloseHandlerParam(Object param)
Sets the parameter for the Handler invoked when the selector is being dismissed
public Object
setContent(HTMLElement selectorContent)
Sets the content of this popup window.
protected Object
SetFocusOnOpen(Boolean focusHint)
public void
setRestoreFocusId(String id)
protected Boolean
ShouldHideOnClip()
Resultant indicates if popup window should hide on clip.
public Object
show(Object hints)
Displays a popup window on the screen.
private Object
_size(Object hints)
Sizes the popup window and then validate the position with the position manager service.
private void
_toggleOffAnimating()
When a popup is open and there is not room for it in the window it foces scroll.
private Object
_unregisterEventHandlers()
Unregisters listeners registered with the document.
protected Object
WrapContent(Object hints, Object content, Object isScreenReaderMode)
Wraps the content of the popup window.


Methods inherited from oracle.adfinternal.view.js.laf.dhtml.internalWindow.AdfAbstractFloatingElement

CreateTable, getAlignElement, getAlignPosition, getElement, GetFirstFormId, GetFloatingType, getHeight, getLeft, getShadowAnchor, getTop, getWidth, raiseToFront, setAlignElement, setAlignPosition, setElement, setLeft, setPosition, setShadowAnchor, setTop


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


_ANIMATE_WRAPPER_EXPANDO

private static Object _ANIMATE_WRAPPER_EXPANDO

__CANCELED_EXPANDO

static Object __CANCELED_EXPANDO

Holds the name of the expando property added to the contentDom of the AdfDhtmlPopupHints.CLOSE_HANDLER_PARAM when the floating element is dismissed by calling cancel.

_isTouchScreen

private Object _isTouchScreen

__POPUPID_EXPANDO

static Object __POPUPID_EXPANDO

__REPLACEDOM_EXPANDO

static Object __REPLACEDOM_EXPANDO

_SCROLL_POSITION_EXPANDO

private static Object _SCROLL_POSITION_EXPANDO

setElement

public Object setElement

Constructor Detail


AdfDhtmlPopupWindow

public AdfDhtmlPopupWindow()

Method Detail


addOpenedHandler

public Object addOpenedHandler(function handler,
                               object params)

Parameters:
handler  -  callback function invoked when the popup is opened
params  -  arguments passed to the hander function
Return:
Object

AnimateOpening

protected Object AnimateOpening(Object animationDuration,
                                Object hints)

Animates the opening of the popup.

Parameters:
animationDuration    
hints  -  a set of popup hints (see AdfDhtmlPopupWindow)
Default value = null
Return:
Object
See also:
GetAnimationDuration()

AnimateUsingWrapper

protected Object AnimateUsingWrapper(Number animationDuration,
                                     Object isAchorRight,
                                     Object isAchorBottom,
                                     Object hints)

Removes the managed dom element replacing with a hidden div. The current coordinates are captured and used as the finals for the animation.

Parameters:
animationDuration  -  elapsed time the opening animation should take. Configured per component as a skinning property.
isAchorRight    
isAchorBottom    
hints  -  a set of popup hints (see AdfDhtmlPopupWindow)
Default value = null
Return:
Object

AnimationComplete

protected static Object AnimationComplete(Object context)

Callback invoked after open animation has completed. Restores the dom element, creates the shadow decorator and then invokes the popup opening logic.

Parameters:
context    
Return:
Object
See also:
_restoreRootPostAnimation(Object)
CreateShadow(Boolean)
OpenedPopup()

_announce

private Object _announce(String messageKey)

Announces a popup status change to assistive technologies.

Parameters:
messageKey  -  identifies the message to announce
Return:
Object

autoSize

public Object autoSize()

Updates the size of the popup to match its content and resizes the shadow decorator.

Return:
Object

cancel

public Object cancel(boolean replaceDom)

Dismisses the floating element indicating an awkward state or unexpected state.

Parameters:
replaceDom  -  optional flag that indicates the popup was canceled due to a dom replacement of its markup.
Return:
Object
Overrides:
AdfAbstractFloatingElement.cancel()

CreateDomElement

protected HTMLElement CreateDomElement()

Create and initialize the html. Subclasses must override this method

Return:
HTMLElement - the root dom element of this popup.

_createFocusPagePropertyKey

private static String _createFocusPagePropertyKey(String clientId)

Generates a key based on the popup's client id by replacing all ":" char's with "$" and then adding a sufix of "$restoreFocus". The returned key is passed to AdfDhtmlPage.setPageProperty(Object, Object) and AdfDhtmlPage.getPageProperty(Object). This value pair will hold the last active dom element before the popup was cancled due to a dom replacement.

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

CreateShadow

protected Object CreateShadow(Boolean afterAnimation)

Creates the shadow for this popup window.

Parameters:
afterAnimation  -  flag indicates that we want to create the shadow after animation
Return:
Object

_delayedCheckedFocus

private Object _delayedCheckedFocus(Object params)

Callback for setting focus with a check to see if the element is focusable and the focus element is outside of the popup element, and there is not currently a focusasble element in focus. (IE focus behavior fix)

Parameters:
params    
Return:
Object

destroy

public Object destroy()

Unregister event handlers, remove the shadow decorator, unregister with the position manager before calling on super.

Return:
Object
Overrides:
AdfAbstractFloatingElement.destroy()

DoResizeNotifyDom

protected Object DoResizeNotifyDom(Object content)

Perform a resize notification traversal when showing popup contents so that geometry managing components are given the opportunity to lay themselves out.

Parameters:
content    
Return:
Object

DoShow

protected Object DoShow(Object hints)

Do the work to actually display of the popup window.

Parameters:
hints  -  a set of popup hints (see AdfDhtmlPopupWindow)
Default value = null
Return:
Object

FocusOnFirstElement

protected Object FocusOnFirstElement()

Sets focus to the first content element in the window.

Return:
Object
See also:
GetFocusContent()

GetAnimateSkinProperty

protected String GetAnimateSkinProperty()

Return:
String - the skin property for -tr-animate

GetAnimationDuration

protected Number GetAnimationDuration()

Return:
Number - the duration of the animation for the popup

GetAnimationDurationSkinProperty

protected String GetAnimationDurationSkinProperty(Object hints)

Parameters:
hints    
Return:
String - the skin property for animation duriation

getContent

public HTMLElement getContent()

Return:
HTMLElement - returns the dom element that is the content of this popup window

GetContentParent

protected HTMLElement GetContentParent()

Gets the dom element that is the parent of the popup's content. Subclasses must override this method

Return:
HTMLElement - contentParentElement the parent of the content

GetFocusContent

protected HTMLElement GetFocusContent()

Returns the content dom node for the popup. This method should be overridden by subclasses to return the inner content area versus the outer border/title dom structure.

Return:
HTMLElement - content area of the popup

GetFocusOnOpen

protected Boolean GetFocusOnOpen()

Return:
Boolean - null true if the popup window should steal focus when opened. The AdfDhtmlPopupHints.FOCUS sets this value.

_getFormElementId

private static String _getFormElementId(HtmlElement node)

Returns the form element id for a given dom node. This implementation walks up the DOM tree until it finds the form element and returns its id or null if the node is disconnected from within a form element.

Parameters:
node  -  content node before reparenting
Return:
String - clientId of the containing form or null

GetLaunchSourceElement

protected Object GetLaunchSourceElement()

Get the launch source element (if available). May return null. This is a protected method and may be overwritten by child classes (AdfDhtmlPopupMenu.js).

Return:
Object

getLaunchSourceId

public String getLaunchSourceId()

Returns the clientId of the launching source if provided using the AdfRichPopup.HINT_LAUNCH_ID popup hint. The launch source id is passed as a popup hint by default when using showPopupBehavior.

Return:
String - clientId of the launching source or null if not provided

GetMaxWidth

protected int GetMaxWidth()

Return:
int - the value passed in by the AdfDhtmlPopupHints.MAX_WIDTH popup hint.

getPopupClientId

public String getPopupClientId()

This getter exposes a popup hint that captures the popups's clientId. It is a quick way to find the owning popup component.

Return:
String - the clientId of the outer popup component

GetPositionManagerIndex

protected Number GetPositionManagerIndex()

Return:
Number - numeric token used by the position manager service to track a registed floating element.

getZorderScope

public int getZorderScope()

Returns the scope that the popup was created. The value is passed as the "AdfDhtmlPopupHints#ZORDER_SCOPE" hint when the popup is shown.

Return:
int - The values include "AdfDhtmlPopupHints#ZORDER_SCOPE_FIRST_FORM", "AdfDhtmlPopupHints#ZORDER_SCOPE_CONTAINED_FORM" and "AdfDhtmlPopupHints#ZORDER_SCOPE_BODY".

HandleEscapeKey

protected Object HandleEscapeKey(Object event)

Overridable function to handle escape key.

Parameters:
event    
Return:
Object

_handleKeyDown

private Object _handleKeyDown(Event event)

Handles the keydown event from the document. The _registerEventHanders and _unregisterEventHandlers functions manage registration and called from the show and hide functions. Intercepts the tab key press to cycle focus within the floating element. If focus is on the last element, focus returns to the first tab-able element in the popup.

Parameters:
event    
Return:
Object

HandleKeyNavigation

protected Object HandleKeyNavigation(Object event)

Overridable function to handle ctr+alt+w window navigation.

Parameters:
event    
Return:
Object

_handleKeyUp

private Object _handleKeyUp(Object event)

Handles the keyup event from the document. The _registerEventHanders and _unregisterEventHandlers functions manage registration and called from the show and hide functions. The ESC key is handled if the HINT_CLOSE_ON_ESCAPE hint was turned on. This logic will hide the floating element if the event target is within the popup. Or, if the HINT_LAUNCH_SOURCE_ID hint is provided, the dom element it points to is considered within the popup.

Parameters:
event    
Return:
Object
See also:
HandleEscapeKey(Object)

_handleResize

private Object _handleResize()

Callback invoked every time the size of the floating element changes.

Return:
Object
See also:
AdfAgent.addResizeListener(String, Function)

HasShadow

protected Object HasShadow()

Return:
Object - whether or not the popup will have a shadow

hide

public Object hide()

Hides this popup window.

Return:
Object
See also:
show(Object)
Overrides:
AdfAbstractFloatingElement.hide()

ImmediateZorderRegistration

protected boolean ImmediateZorderRegistration()

Determines if the target element should be registered immediately with the zorder manager upon its mutator getting called. The significance is when the popup needs to be located under the form element that is the parent of the target popup component.

Return:
boolean - returns false
See also:
show(Object)
setElement
AdfDhtmlZOrderManager.addElementToLayer(HTMLElement, String, HTMLElement, String)
Overrides:
AdfAbstractFloatingElement.ImmediateZorderRegistration()

Init

protected Object Init()

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

Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Return:
Object

isAncestorOrSelf

public static boolean isAncestorOrSelf(Node ancestorNode,
                                       Node domElement)

Checks to see if the "ancestorNode" is a ancestor of "node" or if they are the same. This is a popup specific version of "AdfDomUtils.isAncestorOrSelf" that jumps back to the root dom element of a open popup so that it reflects back to the origianl dom structure before a popup is open. When the popup is open, it's content is reparented in the document.

Parameters:
ancestorNode  -  some root node in the document
domElement  -  target element to check if it is in the "logical" heritage of of the ancestorNode
Return:
boolean - null true if the domElement is found within the heritage of the ancestorNode.

isAnimating

public Object isAnimating()

Returns if the popup window is currently animating during the opening of the window.

Return:
Object - true if the popup is currently animating during opening else false.

_isRestoring

private boolean _isRestoring(AdfRichPopup component)

Used to determine if the popup should restore focus when closed. If the popup is canceled and needs to be restored, we don't need to restore focus prior to when the popup was open.

Parameters:
component  -  popup component
Return:
boolean - true if the component is a AdfRichPopup, property autoCancel is disabled, and the popup was canceled due to a dom replacement.

isVisible

public Boolean isVisible()

Return:
Boolean - indicates the visual state of the selector

OpenedPopup

protected void OpenedPopup()

Invokes the opened handler callback. The callback and parameter list is passed by the invoking peer using the "HINT_CLOSE_HANDLER" and "HINT_CLOSE_HANDLER_PARAM" hint parameters.

Return:
void - null

Position

protected Object Position(String hintAlign)

Registers this floating element with the position manager based on the alignment hint. Unregisters if already registered.

Parameters:
hintAlign  -  alignment constants
Return:
Object

_positionAtMousePointer

private Object _positionAtMousePointer(Object pos)

Registers this floating element with the position manager based on a mouse x,y position.

Parameters:
pos    
Return:
Object

_registerEventHandlers

private Object _registerEventHandlers()

Registers listeners with the document.

Return:
Object

_restoreFocus

private Object _restoreFocus()

Restore the keyboard focus to its previous location

Return:
Object

_restoreRootPostAnimation

private static Object _restoreRootPostAnimation(Object wrapper)

Restores the dom element after animation has completed.

Parameters:
wrapper  -  object holding the content element and instance of this object
Return:
Object

RestoreScrollValues

protected Object RestoreScrollValues(HTMLElement domElement)

Finds all child DOM elements that need their vertical scroll values restored and restores them. By default, vertical scroll values are lost when DOM elements are reparented - which happens when popups are hidden and then reshown. This method looks for saved scroll values on components (that were saved during the popup hide method, and restores any that are found.

Parameters:
domElement  -  the root domElement in the popup
Return:
Object

SaveScrollValues

protected Object SaveScrollValues(HTMLElement domElement)

Finds all child DOM elements that have scroll values and saves their scroll value information. By default, vertical scroll values are lost when DOM elements are reparented - which happens when popups are hidden and then reshown. This method looks for child elements that have vertical scroll values. Any scroll values found are saved so they can be restored if later the popup is shown again.

Parameters:
domElement  -  the root domElement in the popup
Return:
Object

setCloseHandler

public Object setCloseHandler(Function handler)

Sets the Handler invoked when the selector is being dismissed

Parameters:
handler  -  callback
Return:
Object

setCloseHandlerParam

public Object setCloseHandlerParam(Object param)

Sets the parameter for the Handler invoked when the selector is being dismissed

Parameters:
param    
Return:
Object
See also:
setCloseHandler(Function)

setContent

public Object setContent(HTMLElement selectorContent)

Sets the content of this popup window.

Parameters:
selectorContent  -  the dom element that is the content of the popupwindow
Return:
Object

SetFocusOnOpen

protected Object SetFocusOnOpen(Boolean focusHint)

Parameters:
focusHint  -  determines if the popup window should steal focus when opened. The AdfDhtmlPopupHints.FOCUS sets this value.
Return:
Object

setRestoreFocusId

public void setRestoreFocusId(String id)

Parameters:
id  -  of the component that should establish focus when the popup is dismissed.
Return:
void - null

ShouldHideOnClip

protected Boolean ShouldHideOnClip()

Resultant indicates if popup window should hide on clip. This behavior is by default true for non-touch platforms but is inactivated for touch devices.

Return:
Boolean - if popup window should hide on clip

show

public Object show(Object hints)

Displays a popup window on the screen.

Parameters:
hints  -  a set of popup hints (see AdfDhtmlPopupWindow)
Default value = null
Return:
Object
See also:
hide()
Overrides:
AdfAbstractFloatingElement.show()

_size

private Object _size(Object hints)

Sizes the popup window and then validate the position with the position manager service. If animation is enabled, animate the window sizing from the alignment computed by the position manager.

Parameters:
hints  -  a set of popup hints (see AdfDhtmlPopupWindow)
Default value = null
Return:
Object

_toggleOffAnimating

private void _toggleOffAnimating()

When a popup is open and there is not room for it in the window it foces scroll. In IE this causes several "resize" events. The last resize is after popup has been open and animation stopped. This function is called in a timeout period for IE giving the position manager more time to process the resize events and discard if still animating.

Return:
void - null
See also:
"#_animationComplete"

_unregisterEventHandlers

private Object _unregisterEventHandlers()

Unregisters listeners registered with the document.

Return:
Object

WrapContent

protected Object WrapContent(Object hints,
                             Object content,
                             Object isScreenReaderMode)

Wraps the content of the popup window.

Parameters:
hints    
content    
isScreenReaderMode    
Return:
Object - the wrapped content

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.