OracleJavaScript API Reference for Oracle ADF Faces

 

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

oracle.adfinternal.view.js.behavior
Class AdfAutoSuggestBehavior

Warning:

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

public class AdfAutoSuggestBehavior
extends AdfClientBehavior
Client behavior implementation to show the suggestedItems in a dropdown for editable input components. isSmartListEnabled - indicates whether smartList is enabled maxSuggestedItems - maxSuggestedItems configured isLOVComponent - indicates whether the component associated is lov component



Field Summary

private static Object
_BUSY_DIV_ID
private static Object
_clicked_in_suggestitems
private Object
_isLOVComponent
private Object
_isSmartListEnabled
private static Object
_ITEM_VALUE_ATTR
private static Object
_itemsCache
private Object
_maxSuggestedItems
private static Object
_MORE_LINK_ID
private static Object
_MORE_LINK_STYLE
private static Object
_NON_INTERACTIVE_ITEM
private static Object
_POPUP_CONTAINER_DIV_ID
private static Object
_POPUP_CONTAINER_STYLE
private static Object
_POPUP_PANEL_ID
private static Object
_SELECTED_ITEM_INDEX
private static Object
_SELECTED_STYLE_CLASS
public static Object
SUGGEST_BUSY_STYLE
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
AdfAutoSuggestBehavior(Object isSmartListEnabled, Object maxSuggestedItems, Object isLOVComponent)
Client behavior implementation to show the suggestedItems in a dropdown for editable input components.


Method Summary

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
_adjustForScrollBars(Object ulElement)
private Object
_autoSuggest(Object component)
private static 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 static Object
_clearCache()
private static Object
_clearSuggestedItemsCache()
private static Object
_createPopupContent(Object component, Object clientId, Object ownerDoc, Object agent)
Convenience funtion to create the skeleton content of the popup
private Object
_filterSmartList(Object smartList, Object submittedValue)
Filters the list with the starts with filter
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
_fireMouseIn(Object componentEvent)
Handles the mouse over on autoSuggest popup.
private Object
_fireMouseOut(Object componentEvent)
Handles the mouse out inside autoSuggest popup.
private Object
_getCurrentSelectedItem(Object popupContent, Object selectedIndex)
Gets the current highlighted item.
private Object
_getItemChildOfTagName(Object item, Object tagName)
Return the first child element if it exists and if its tag name matches the specified value.
private Object
_getMoreLinkIfApplicable(Object item)
private static Object
_getSuggestedItemsFromCache(Object submittedValue)
protected Object
Init(Object isSmartListEnabled, 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.
private Object
_isBusyIndicator(Object item)
private Object
_isItemSeparator(Object item)
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
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 static Object
_showDropDown(Object component, Object peer, Object clientId, Object ulElement)
Convenience funtion to show the popup
private static 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 Object
_updateSelectedStyle(Object liElement, Object selected)
Adds or removes the selected style classes for the specified LI element (and its child).


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

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


Field Detail


_BUSY_DIV_ID

private static Object _BUSY_DIV_ID

_clicked_in_suggestitems

private static Object _clicked_in_suggestitems

_isLOVComponent

private Object _isLOVComponent

_isSmartListEnabled

private Object _isSmartListEnabled

_ITEM_VALUE_ATTR

private static Object _ITEM_VALUE_ATTR

_itemsCache

private static Object _itemsCache

_maxSuggestedItems

private Object _maxSuggestedItems

_MORE_LINK_ID

private static Object _MORE_LINK_ID

_MORE_LINK_STYLE

private static Object _MORE_LINK_STYLE

_NON_INTERACTIVE_ITEM

private static Object _NON_INTERACTIVE_ITEM

_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_ITEM_INDEX

private static Object _SELECTED_ITEM_INDEX

_SELECTED_STYLE_CLASS

private static Object _SELECTED_STYLE_CLASS

SUGGEST_BUSY_STYLE

public static Object SUGGEST_BUSY_STYLE

_SUGGEST_ITEMS_ID

private static Object _SUGGEST_ITEMS_ID

_SUGGESTED_ITEM_STYLE

private static Object _SUGGESTED_ITEM_STYLE

Constructor Detail


AdfAutoSuggestBehavior

public AdfAutoSuggestBehavior(Object isSmartListEnabled,
                              Object maxSuggestedItems,
                              Object isLOVComponent)

Client behavior implementation to show the suggestedItems in a dropdown for editable input components. isSmartListEnabled - indicates whether smartList is enabled maxSuggestedItems - maxSuggestedItems configured isLOVComponent - indicates whether the component associated is lov component

Parameters:
isSmartListEnabled    
maxSuggestedItems    
isLOVComponent    

Method Detail


_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

_adjustForScrollBars

private static Object _adjustForScrollBars(Object ulElement)

Parameters:
ulElement    
Return:
Object

_autoSuggest

private Object _autoSuggest(Object component)

Parameters:
component    
Return:
Object

_cacheSuggestedItems

private static 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 static Object _clearCache()

Return:
Object

_clearSuggestedItemsCache

private static Object _clearSuggestedItemsCache()

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

_filterSmartList

private Object _filterSmartList(Object smartList,
                                Object submittedValue)

Filters the list with the starts with filter

Parameters:
smartList    
submittedValue    
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. sets the value selected as display value of the component

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 _clicked_in_suggestitems is set to true.

Parameters:
componentEvent    
Return:
Object

_fireMouseIn

private Object _fireMouseIn(Object componentEvent)

Handles the mouse over on autoSuggest popup. Highlights the item on which the mouse is hover

Parameters:
componentEvent    
Return:
Object

_fireMouseOut

private Object _fireMouseOut(Object componentEvent)

Handles the mouse out inside autoSuggest popup. Removes the highlighted styleclass from the item.

Parameters:
componentEvent    
Return:
Object

_getCurrentSelectedItem

private Object _getCurrentSelectedItem(Object popupContent,
                                       Object selectedIndex)

Gets the current highlighted item.

Parameters:
popupContent    
selectedIndex    
Return:
Object

_getItemChildOfTagName

private Object _getItemChildOfTagName(Object item,
                                      Object tagName)

Return the first child element if it exists and if its tag name matches the specified value. Return null otherwise.

Parameters:
item    
tagName    
Return:
Object

_getMoreLinkIfApplicable

private Object _getMoreLinkIfApplicable(Object item)

Parameters:
item    
Return:
Object

_getSuggestedItemsFromCache

private static Object _getSuggestedItemsFromCache(Object submittedValue)

Parameters:
submittedValue    
Return:
Object

Init

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

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

Parameters:
isSmartListEnabled    
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)

_isBusyIndicator

private Object _isBusyIndicator(Object item)

Parameters:
item    
Return:
Object

_isItemSeparator

private Object _isItemSeparator(Object item)

Parameters:
item    
Return:
Object

_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

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 static 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 static 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 Object _updateSelectedStyle(Object liElement,
                                    Object selected)

Adds or removes the selected style classes for the specified LI element (and its child).

Parameters:
liElement    
selected    
Return:
Object

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

 

Generated on 2011.04.05 23:36 UTC
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.