OracleJavaScript API Reference for Oracle ADF Faces

 

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

oracle.adfinternal.view.js.behavior
Class AdfAutoSuggestBehaviorImpl

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adf.view.js.base.AdfClientBehavior
               |
               +--oracle.adf.view.js.behavior.AdfAutoSuggestBehavior
                     |
                     +--oracle.adfinternal.view.js.behavior.AdfAutoSuggestBehaviorImpl

public class AdfAutoSuggestBehaviorImpl
extends AdfAutoSuggestBehavior
Client behavior implementation to show the suggestedItems in a dropdown for editable input components. isSmartListEnabled - indicates whether smartList is enabled minChars - Indicates minimum characters to be entered in the input field for autoSuggest panel to be displayed maxSuggestedItems - maxSuggestedItems configured isLOVComponent - indicates whether the component associated is lov component



Field Summary

private static Object
_BUSY_DIV_ID
private Object
_isLOVComponent
private Object
_isSmartListEnabled
private static Object
_ITEM_LABEL_ATTR
private static Object
_ITEM_VALUE_ATTR
private Object
_maxSuggestedItems
private Object
_minChars
private static Object
_MORE_LINK_ID
private static Object
_MORE_LINK_STYLE
private static Object
_POPUP_CONTAINER_DIV_ID
private static Object
_POPUP_CONTAINER_STYLE
private static Object
_POPUP_PANEL_ID
private static Object
_SELECTED_STYLE_CLASS
private static Object
_SMART_ITEM_ID
public static Object
SUGGEST_BUSY_STYLE
private static Object
_SUGGEST_ITEM_ID
private static Object
_SUGGEST_ITEMS_ID
private static Object
_SUGGESTED_ITEM_STYLE


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

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfAutoSuggestBehaviorImpl(Object isSmartListEnabled, Object minChars, Object maxSuggestedItems, Object isLOVComponent)
Client behavior implementation to show the suggestedItems in a dropdown for editable input components.


Method Summary

private static Object
_addBusyDiv(Object ownerDoc, Object ulElement, Object clientId, Object laf)
private static Object
_addMoreLink(Object ownerDoc, Object ulElement, Object clientId, Object isSmartList, Object maxSuggestedItems, Object submittedValue, Object laf)
Convenience funtion to add the more link as the last child to ulElement parameter
private static Object
_addSeparator(Object ownerDoc, Object ulElement)
private static Object
_addSuggestItems(Object ownerDoc, Object ulElement, Object clientId, Object suggestedItems, Object isSmartList, Object laf)
private static Object
_adjustForScrollBars(Object ulElement)
private Object
_autoSuggest(Object component)
private Object
_cacheSuggestedItems(Object submittedValue, Object suggestedItems)
private Object
_cancelSmartListTimer()
Cancels the smart list timer if the timer is not fired.
private Object
_cancelSuggestTimer()
Cancels the _timerId when the blur event is fired.
private Object
_clearCache()
private Object
_clearSuggestedItemsCache()
private static Object
_convertToSelectItems(Object suggestedItems, Object selectItems)
private static Object
_createPopupContent(Object component, Object clientId, Object ownerDoc, Object agent)
Convenience funtion to create the skeleton content of the popup
private Object
_fireBlur(Object componentEvent)
Handler for the blur event.
private Object
_fireClick(Object componentEvent)
Handles the click event inside autoSuggest popup.
private Object
_fireFocus(Object componentEvent)
private Object
_fireKeyDown(Object event)
Handles the keyDown event.
private Object
_fireKeyUp(Object componentEvent)
Handler for the keyUp event.
private Object
_fireMouseDown(Object componentEvent)
Handler for the mouse down event.
private Object
_firePopupClosed(Object component)
Invoked when the autosuggest popup is closed
private Object
_firePopupOpening(Object component)
Invoked when the autosuggest popup is being launched
private Object
_getCurrentSelectedItemId(Object contentNode)
Gets the current highlighted item.
public Object
getSuggestedItems(Object component)
Returns the currently available selected items for the current input element value
protected Object
Init(Object isSmartListEnabled, Object minChars, Object maxSuggestedItems, Object isLOVComponent)
Initializes the instance.
protected static Object
InitClass()
public Object
initialize(Object component)
The initialize method is called back to notify the AdfClientBehavior that it is time to perform any required initialization work on the component.
public static Object
isPopupVisible(Object component, Object peer)
Returns true if autosuggest popup is displayed
private static Boolean
_isSuggestItemOrMoreLink(HTMLElement element)
Determine if the element is a suggest item or More...
private Object
_queueAutoSuggestEvent(Object params)
Queues the autoSuggest event to get the suggestedItems from the server params[0] - component instance params[1] - submittedValue params[2] - targetNode
private Object
_selectNewItem(HTMLElement contentNode, HTMLElement suggestItemsContainer, HTMLElement isFindNextItem)
Determines and selects a new item when Up/Down arrow key is pressed
public static Object
showAutoSuggestPopup(Object clientId, Object submittedValue, Object suggestedItems, Object isSmartList, Object maxSuggestedItems, Object isLOVComponent, Object requestId)
The function gets called from server in response to customEvent of type _autoSuggest finds the AutoSuggestBehavior instance from the component and shows the dropdown popup with the suggestedItems for smartList items, suggestedItems will be cached on the component instance suggestedItems will be cached against the submittedValue for suggestItems
private Object
_showDropdown(Object component, Object peer, Object clientId, Object ulElement)
Convenience funtion to show the popup
private Object
_showPopup(Object component, Object submittedValue, Object clientId, Object suggestedItems, Object isSmartList, Object maxSuggestedItems, Object isLOVComponent)
Constructs the popup content dom from the suggestedItems and calls the AdfRichUIPeer.showPopup() api to show the popup
private static Object
_updateSelectedStyle(Object element, Object selected)
Adds or removes the selected style classes for the specified element.


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

destroy


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


_BUSY_DIV_ID

private static Object _BUSY_DIV_ID

_isLOVComponent

private Object _isLOVComponent

_isSmartListEnabled

private Object _isSmartListEnabled

_ITEM_LABEL_ATTR

private static Object _ITEM_LABEL_ATTR

_ITEM_VALUE_ATTR

private static Object _ITEM_VALUE_ATTR

_maxSuggestedItems

private Object _maxSuggestedItems

_minChars

private Object _minChars

_MORE_LINK_ID

private static Object _MORE_LINK_ID

_MORE_LINK_STYLE

private static Object _MORE_LINK_STYLE

_POPUP_CONTAINER_DIV_ID

private static Object _POPUP_CONTAINER_DIV_ID

_POPUP_CONTAINER_STYLE

private static Object _POPUP_CONTAINER_STYLE

_POPUP_PANEL_ID

private static Object _POPUP_PANEL_ID

_SELECTED_STYLE_CLASS

private static Object _SELECTED_STYLE_CLASS

_SMART_ITEM_ID

private static Object _SMART_ITEM_ID

SUGGEST_BUSY_STYLE

public static Object SUGGEST_BUSY_STYLE

_SUGGEST_ITEM_ID

private static Object _SUGGEST_ITEM_ID

_SUGGEST_ITEMS_ID

private static Object _SUGGEST_ITEMS_ID

_SUGGESTED_ITEM_STYLE

private static Object _SUGGESTED_ITEM_STYLE

Constructor Detail


AdfAutoSuggestBehaviorImpl

public AdfAutoSuggestBehaviorImpl(Object isSmartListEnabled,
                                  Object minChars,
                                  Object maxSuggestedItems,
                                  Object isLOVComponent)

Client behavior implementation to show the suggestedItems in a dropdown for editable input components. isSmartListEnabled - indicates whether smartList is enabled minChars - Indicates minimum characters to be entered in the input field for autoSuggest panel to be displayed maxSuggestedItems - maxSuggestedItems configured isLOVComponent - indicates whether the component associated is lov component

Parameters:
isSmartListEnabled    
minChars    
maxSuggestedItems    
isLOVComponent    

Method Detail


_addBusyDiv

private static Object _addBusyDiv(Object ownerDoc,
                                  Object ulElement,
                                  Object clientId,
                                  Object laf)

Parameters:
ownerDoc    
ulElement    
clientId    
laf    
Return:
Object

_addMoreLink

private static Object _addMoreLink(Object ownerDoc,
                                   Object ulElement,
                                   Object clientId,
                                   Object isSmartList,
                                   Object maxSuggestedItems,
                                   Object submittedValue,
                                   Object laf)

Convenience funtion to add the more link as the last child to ulElement parameter

Parameters:
ownerDoc    
ulElement    
clientId    
isSmartList    
maxSuggestedItems    
submittedValue    
laf    
Return:
Object

_addSeparator

private static Object _addSeparator(Object ownerDoc,
                                    Object ulElement)

Parameters:
ownerDoc    
ulElement    
Return:
Object

_addSuggestItems

private static Object _addSuggestItems(Object ownerDoc,
                                       Object ulElement,
                                       Object clientId,
                                       Object suggestedItems,
                                       Object isSmartList,
                                       Object laf)

Parameters:
ownerDoc    
ulElement    
clientId    
suggestedItems    
isSmartList    
laf    
Return:
Object

_adjustForScrollBars

private static Object _adjustForScrollBars(Object ulElement)

Parameters:
ulElement    
Return:
Object

_autoSuggest

private Object _autoSuggest(Object component)

Parameters:
component    
Return:
Object

_cacheSuggestedItems

private Object _cacheSuggestedItems(Object submittedValue,
                                    Object suggestedItems)

Parameters:
submittedValue    
suggestedItems    
Return:
Object

_cancelSmartListTimer

private Object _cancelSmartListTimer()

Cancels the smart list timer if the timer is not fired.

Return:
Object

_cancelSuggestTimer

private Object _cancelSuggestTimer()

Cancels the _timerId when the blur event is fired.

Return:
Object

_clearCache

private Object _clearCache()

Return:
Object

_clearSuggestedItemsCache

private Object _clearSuggestedItemsCache()

Return:
Object

_convertToSelectItems

private static Object _convertToSelectItems(Object suggestedItems,
                                            Object selectItems)

Parameters:
suggestedItems    
selectItems    
Return:
Object

_createPopupContent

private static Object _createPopupContent(Object component,
                                          Object clientId,
                                          Object ownerDoc,
                                          Object agent)

Convenience funtion to create the skeleton content of the popup

Parameters:
component    
clientId    
ownerDoc    
agent    
Return:
Object

_fireBlur

private Object _fireBlur(Object componentEvent)

Handler for the blur event. Clear the cache when the input field loses focus When the user clicks inside the autoSuggest popup, cache will not be cleared

Parameters:
componentEvent    
Return:
Object

_fireClick

private Object _fireClick(Object componentEvent)

Handles the click event inside autoSuggest popup.

Parameters:
componentEvent    
Return:
Object

_fireFocus

private Object _fireFocus(Object componentEvent)

Parameters:
componentEvent    
Return:
Object

_fireKeyDown

private Object _fireKeyDown(Object event)

Handles the keyDown event. records node value length such that _fireKeyUp will queue the _autoSuggest event only when a valid key is entered in the input field.

Parameters:
event    
Return:
Object

_fireKeyUp

private Object _fireKeyUp(Object componentEvent)

Handler for the keyUp event. When there is a value change in the inputfield, schedules the timer to queue the customEvent to the server to get the suggestedItems. Also handles the up and down arrow keys to navigate between the items in the popup when enter key is pressed on an item, sets the value of the item as the display value of the input component.

Parameters:
componentEvent    
Return:
Object

_fireMouseDown

private Object _fireMouseDown(Object componentEvent)

Handler for the mouse down event. If mouse down happens in the autosuggest list, boolean _clickedInSuggestitems is set to true and the value selected is set as display value of the component.

Parameters:
componentEvent    
Return:
Object

_firePopupClosed

private Object _firePopupClosed(Object component)

Invoked when the autosuggest popup is closed

Parameters:
component    
Return:
Object

_firePopupOpening

private Object _firePopupOpening(Object component)

Invoked when the autosuggest popup is being launched

Parameters:
component    
Return:
Object

_getCurrentSelectedItemId

private Object _getCurrentSelectedItemId(Object contentNode)

Gets the current highlighted item. For keyboard purpose only

Parameters:
contentNode    
Return:
Object

getSuggestedItems

public Object getSuggestedItems(Object component)

Returns the currently available selected items for the current input element value

Parameters:
component    
Return:
Object
Overrides:
AdfAutoSuggestBehavior.getSuggestedItems(Object)

Init

protected Object Init(Object isSmartListEnabled,
                      Object minChars,
                      Object maxSuggestedItems,
                      Object isLOVComponent)

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

Parameters:
isSmartListEnabled    
minChars    
maxSuggestedItems    
isLOVComponent    
Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Return:
Object

initialize

public Object initialize(Object component)

The initialize method is called back to notify the AdfClientBehavior that it is time to perform any required initialization work on the component. Typically this means registering event handlers.

Parameters:
component    
Return:
Object
Overrides:
AdfClientBehavior.initialize(Object)

isPopupVisible

public static Object isPopupVisible(Object component,
                                    Object peer)

Returns true if autosuggest popup is displayed

Parameters:
component    
peer    
Return:
Object

_isSuggestItemOrMoreLink

private static Boolean _isSuggestItemOrMoreLink(HTMLElement element)

Determine if the element is a suggest item or More... link

Parameters:
element  -  The element to check
Return:
Boolean - true if element is a suggest item or More... link, false otherwise

_queueAutoSuggestEvent

private Object _queueAutoSuggestEvent(Object params)

Queues the autoSuggest event to get the suggestedItems from the server params[0] - component instance params[1] - submittedValue params[2] - targetNode

Parameters:
params    
Return:
Object

_selectNewItem

private Object _selectNewItem(HTMLElement contentNode,
                              HTMLElement suggestItemsContainer,
                              HTMLElement isFindNextItem)

Determines and selects a new item when Up/Down arrow key is pressed

Parameters:
contentNode  -  The editable input field
suggestItemsContainer  -  The container of suggest items and More... link
isFindNextItem  -  If true, next item is to be selected. Else, previous item is to be selected
Return:
Object

showAutoSuggestPopup

public static Object showAutoSuggestPopup(Object clientId,
                                          Object submittedValue,
                                          Object suggestedItems,
                                          Object isSmartList,
                                          Object maxSuggestedItems,
                                          Object isLOVComponent,
                                          Object requestId)

The function gets called from server in response to customEvent of type _autoSuggest finds the AutoSuggestBehavior instance from the component and shows the dropdown popup with the suggestedItems for smartList items, suggestedItems will be cached on the component instance suggestedItems will be cached against the submittedValue for suggestItems

Parameters:
clientId    
submittedValue    
suggestedItems    
isSmartList    
maxSuggestedItems    
isLOVComponent    
requestId    
Return:
Object

_showDropdown

private Object _showDropdown(Object component,
                             Object peer,
                             Object clientId,
                             Object ulElement)

Convenience funtion to show the popup

Parameters:
component    
peer    
clientId    
ulElement    
Return:
Object

_showPopup

private Object _showPopup(Object component,
                          Object submittedValue,
                          Object clientId,
                          Object suggestedItems,
                          Object isSmartList,
                          Object maxSuggestedItems,
                          Object isLOVComponent)

Constructs the popup content dom from the suggestedItems and calls the AdfRichUIPeer.showPopup() api to show the popup

Parameters:
component    
submittedValue    
clientId    
suggestedItems    
isSmartList    
maxSuggestedItems    
isLOVComponent    
Return:
Object

_updateSelectedStyle

private static Object _updateSelectedStyle(Object element,
                                           Object selected)

Adds or removes the selected style classes for the specified element.

Parameters:
element    
selected    
Return:
Object

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

 

Generated on 2015.07.15 10:12 UTC
Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.