OracleJavaScript API Reference for Oracle ADF Faces

 

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

oracle.adfinternal.view.js.laf.dhtml.inputSearch
Class AdfSuggestionsPanel

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.laf.dhtml.inputSearch.AdfSuggestionsPanel
Direct Known Subclasses:
AdfMultiSelectPanel, AdfSingleSelectPanel

public class AdfSuggestionsPanel
extends AdfObject
Base class of AdfSingleSelectPanel and AdfMultiSelectPanel to manage rendering, event-handling and everything else related to suggestions panel. The suggestionsPanel is the content/child of suggestionsContainer element rendered by the inputSearch component. This class talks back to the peer to set the value on making a selection, and for any operation related to suggestions popup


Field Summary

private static Object
_ACTIVE_CELL_ID
private static Object
_CONTENT_HEADER_SUB_ID
private static Object
_CONTENT_STAMP_SUB_ID
private static Object
_HIGHLIGHT_MARKER
private static Object
_HIGHLIGHT_MARKER_REPLACE_REGEX
private static Object
_LABEL_FETCHING
private static Object
_LABEL_NO_DATA
private static Object
_LABEL_NO_MATCHES
private static Object
_LIST_ITEMS_CONTAINER_STYLE_CLASS
private static Object
_NO_SUGGESTIONS_MESSAGE_STYLE_CLASS
private Object
_peer
private static Object
_POPUP_RESIZE_TIME
private Object
_prepareTemplates
private static Object
_ROW_ITEMS_CONTAINER_STYLE_CLASS
private static Object
_SERVER_FILTERING_INDICATOR_SUB_ID
private static Object
_SERVER_FILTERING_STYLE_CLASS
private static Object
_SUGGEST_ITEM_SUB_ID
private static Object
_SUGGESTION_ITEM_MATCHING_TEXT_STYLE_CLASS
private static Object
_SUGGESTION_LIST_ITEM_STYLE_CLASS
private static Object
_SUGGESTION_ROW_HEADER_STYLE_CLASS
private static Object
_SUGGESTION_ROW_ITEM_STYLE_CLASS
private static Object
_SUGGESTIONS_BODY_SUB_ID
private static Object
_SUGGESTIONS_COUNT_MSG
private static Object
_SUGGESTIONS_MERGED_MSG
 static Object
__SUGGESTIONS_RENDERING_CHUNK_SIZE
private static Object
_VALUE_ATTRIBUTE_EXPANDO

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

constructor, superclass

Fields inherited from org.ecmascript.object.Object

prototype

Constructor Summary

public
AdfSuggestionsPanel(Object peer)
Base class of AdfSingleSelectPanel and AdfMultiSelectPanel to manage rendering, event-handling and everything else related to suggestions panel.

Method Summary

private static Object
_adjustHeightToRowCount(AdfRichInputSearch component, HTMLElement firstItem)
Adjusts the height of the suggestionsContainer per rowCount property.
private Object
_adjustPopupDimensions(Object suggestions)
private static Object
_appendContentHeader(Object component, Object suggestionsDomFragment)
public static Object
appendHeader(Object isTableMode, Object headerHtml, Object suggestionsDomFragment, Object styleClass, Object id)
private Object
_appendSuggestions(Object suggestions, Object shouldHighlight, Object renderHeader, Object startIndex, Object endIndex)
public Object
clear(Object contentNode, Object underAutocompletion)
Invoked when the suggestionsContainer is being cleared off either to dismiss the suggestions popup, or to display new set of suggestions
protected Object
CreateSampleListItem(Object isTableMode, Object listSize)
private Object
_createSuggestionsDomFragment(Object suggestions, Object options, Object renderHeader, Object startIndex, Object size)
private static Object
_deDuplicateSuggestions(Object component, Object displayedSuggestionsChain, Object suggestions, Object source)
private static Object
_getContentHeaderFacet(Object component)
private static Object
_getContentHeaderFacetElement(Object component)
private static Object
_getContentHeaderHeight(Object suggestionsBody)
private static Object
_getContentStampContainer(Object component)
private Object
_getContentStampTemplate(Object isFilter)
private static Object
_getCurrentSelectedItem(Object contentNode)
Gets the current highlighted item.
public AdfChainSuggestionsMap
getDisplayedSuggestions()
private static Object
_getHighlightRegex(Object component)
private static Object
_getHighlightTextWrapperHtml(Object component)
private static String
_getListItemContent(Object data, Object matchRegex, Object replaceStr, Object template, Object templateAttributes)
Returns the client template based suggestion content for the suggestion data passed.
protected static Object
GetNextItem(Object component, Object isFindNextItem, Object currentItem)
private static Object
_getPartialSuggestionsLoadingIndicator(Object component)
protected Object
GetPeer()
protected Object
GetSelectedItemTemplate(Object template)
protected Object
GetSelectedSampleListItem(Object sampleListItem)
Modifies the a clone of sampleListItem as appropriate to use it for selected state
public static Object
getSuggestionElement(Object element, HTMLElement rootElement)
Finds the closest ancestor element that is a suggestion item.
private static Object
_getSuggestionsBody(Object component)
public static Object
getSuggestionsBodyId(Object component)
public static Object
getSuggestItemIdPrefix(Object clientId)
private Object
_getTemplateAttributes()
protected static Object
GetValueFromItem(Object component, Object suggestItem)
private static Object
_getWhitespacePreservedMatcher(Object contentNodeValue)
private static Object
_getXthElement(Object element, Object rowCount)
public Object
handleClick(Object eventTarget)
private Object
_handleEnterKey(Object component, Object contentNode)
public Object
handleKeyDown(Object componentEvent, Object contentNode)
public static Object
hasPartialDisplayedList(Object component)
protected Object
Init(Object peer)
Initializes the instance.
protected static Object
InitClass()
private Object
_initContentStampTemplate(Object component)
protected Object
IsSelected(Object value)
private Object
_isSuggestionsPopupUpdated(Object suggestions)
protected static Boolean
IsSuggestItem(HTMLElement element)
Determine if the element is a suggest item
private Object
_manageSuggestionsPopupHeight(Object suggestions)
Sets the height of the suggestions panel to display the first 'X' suggestion items as configured on the rowCount attribute of the component.
private Object
_prepareTemplates(Object component)
public static Boolean
removePartialSuggestionsLoadingIndicator(AdfRichInputSearch component, Object dontRemove)
Removes the partial suggestions list busy indicator if one is This busy indicator is added in a) While appending multiple search section in initial suggestion display b) While appending server filtered suggestions to client filtered suggestions
public Object
render(Object component, Object suggestions, Object renderingContext)
private static Object
_renderNoSuggestionsMessage(Object component, Object isFiltering)
private Object
_renderPartialSuggestionsList(Object component, Object suggestions, Object renderingContext)
private static Object
_renderServerLoadingIndicator(Object component, Object container)
private Object
_selectNewItem(AdfUIComponent component, HTMLElement contentNode, Boolean isFindNextItem)
Determines and selects a new item when Up/Down arrow key is pressed
protected Object
SelectSuggestItem(Object component, Object newValue, Object suggestionElem)
private Object
_setDisplayedSuggestions(Object suggestions)
private static Object
_speakUpNewCell(Object component, Object contentNode, Object isNext)
Helps in cell navigation by changing aria-activedescendant property.
public Object
update(AdfRichInputSearch component, AdfSuggestionMap suggestions, Boolean isMasterList)
Invoked once the REST call is complete to update the rendered preferred suggestions with fresh data
protected Object
WrapContentHeaderTemplate(Object template)
protected Object
WrapContentStampTemplate(Object component, Object template)
protected Object
WrapSectionHeaderTemplate(Object component, Object section, Object template)

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


_ACTIVE_CELL_ID

private static Object _ACTIVE_CELL_ID

_CONTENT_HEADER_SUB_ID

private static Object _CONTENT_HEADER_SUB_ID

_CONTENT_STAMP_SUB_ID

private static Object _CONTENT_STAMP_SUB_ID

_HIGHLIGHT_MARKER

private static Object _HIGHLIGHT_MARKER

_HIGHLIGHT_MARKER_REPLACE_REGEX

private static Object _HIGHLIGHT_MARKER_REPLACE_REGEX

_LABEL_FETCHING

private static Object _LABEL_FETCHING

_LABEL_NO_DATA

private static Object _LABEL_NO_DATA

_LABEL_NO_MATCHES

private static Object _LABEL_NO_MATCHES

_LIST_ITEMS_CONTAINER_STYLE_CLASS

private static Object _LIST_ITEMS_CONTAINER_STYLE_CLASS

_NO_SUGGESTIONS_MESSAGE_STYLE_CLASS

private static Object _NO_SUGGESTIONS_MESSAGE_STYLE_CLASS

_peer

private Object _peer

_POPUP_RESIZE_TIME

private static Object _POPUP_RESIZE_TIME

_prepareTemplates

private Object _prepareTemplates

_ROW_ITEMS_CONTAINER_STYLE_CLASS

private static Object _ROW_ITEMS_CONTAINER_STYLE_CLASS

_SERVER_FILTERING_INDICATOR_SUB_ID

private static Object _SERVER_FILTERING_INDICATOR_SUB_ID

_SERVER_FILTERING_STYLE_CLASS

private static Object _SERVER_FILTERING_STYLE_CLASS

_SUGGEST_ITEM_SUB_ID

private static Object _SUGGEST_ITEM_SUB_ID

_SUGGESTION_ITEM_MATCHING_TEXT_STYLE_CLASS

private static Object _SUGGESTION_ITEM_MATCHING_TEXT_STYLE_CLASS

_SUGGESTION_LIST_ITEM_STYLE_CLASS

private static Object _SUGGESTION_LIST_ITEM_STYLE_CLASS

_SUGGESTION_ROW_HEADER_STYLE_CLASS

private static Object _SUGGESTION_ROW_HEADER_STYLE_CLASS

_SUGGESTION_ROW_ITEM_STYLE_CLASS

private static Object _SUGGESTION_ROW_ITEM_STYLE_CLASS

_SUGGESTIONS_BODY_SUB_ID

private static Object _SUGGESTIONS_BODY_SUB_ID

_SUGGESTIONS_COUNT_MSG

private static Object _SUGGESTIONS_COUNT_MSG

_SUGGESTIONS_MERGED_MSG

private static Object _SUGGESTIONS_MERGED_MSG

__SUGGESTIONS_RENDERING_CHUNK_SIZE

static Object __SUGGESTIONS_RENDERING_CHUNK_SIZE

_VALUE_ATTRIBUTE_EXPANDO

private static Object _VALUE_ATTRIBUTE_EXPANDO

Constructor Detail


AdfSuggestionsPanel

public AdfSuggestionsPanel(Object peer)

Base class of AdfSingleSelectPanel and AdfMultiSelectPanel to manage rendering, event-handling and everything else related to suggestions panel. The suggestionsPanel is the content/child of suggestionsContainer element rendered by the inputSearch component. This class talks back to the peer to set the value on making a selection, and for any operation related to suggestions popup

Parameters:
peer  

Method Detail


_adjustHeightToRowCount

private static Object _adjustHeightToRowCount(AdfRichInputSearch component,
                                              HTMLElement firstItem)

Adjusts the height of the suggestionsContainer per rowCount property.

Parameters:
component  
firstItem - The first element in the suggestionsBody
Return:
Object

_adjustPopupDimensions

private Object _adjustPopupDimensions(Object suggestions)

Parameters:
suggestions  
Return:
Object

_appendContentHeader

private static Object _appendContentHeader(Object component,
                                           Object suggestionsDomFragment)

Parameters:
component  
suggestionsDomFragment  
Return:
Object

appendHeader

public static Object appendHeader(Object isTableMode,
                                  Object headerHtml,
                                  Object suggestionsDomFragment,
                                  Object styleClass,
                                  Object id)

Parameters:
isTableMode  
headerHtml  
suggestionsDomFragment  
styleClass  
id  
Return:
Object

_appendSuggestions

private Object _appendSuggestions(Object suggestions,
                                  Object shouldHighlight,
                                  Object renderHeader,
                                  Object startIndex,
                                  Object endIndex)

Parameters:
suggestions  
shouldHighlight  
renderHeader  
startIndex  
endIndex  
Return:
Object

clear

public Object clear(Object contentNode,
                    Object underAutocompletion)

Invoked when the suggestionsContainer is being cleared off either to dismiss the suggestions popup, or to display new set of suggestions

Parameters:
contentNode  
underAutocompletion  
Return:
Object

CreateSampleListItem

protected Object CreateSampleListItem(Object isTableMode,
                                      Object listSize)

Parameters:
isTableMode  
listSize  
Return:
Object

_createSuggestionsDomFragment

private Object _createSuggestionsDomFragment(Object suggestions,
                                             Object options,
                                             Object renderHeader,
                                             Object startIndex,
                                             Object size)

Parameters:
suggestions  
options  
renderHeader  
startIndex  
size  
Return:
Object

_deDuplicateSuggestions

private static Object _deDuplicateSuggestions(Object component,
                                              Object displayedSuggestionsChain,
                                              Object suggestions,
                                              Object source)

Parameters:
component  
displayedSuggestionsChain  
suggestions  
source  
Return:
Object

_getContentHeaderFacet

private static Object _getContentHeaderFacet(Object component)

Parameters:
component  
Return:
Object

_getContentHeaderFacetElement

private static Object _getContentHeaderFacetElement(Object component)

Parameters:
component  
Return:
Object

_getContentHeaderHeight

private static Object _getContentHeaderHeight(Object suggestionsBody)

Parameters:
suggestionsBody  
Return:
Object

_getContentStampContainer

private static Object _getContentStampContainer(Object component)

Parameters:
component  
Return:
Object

_getContentStampTemplate

private Object _getContentStampTemplate(Object isFilter)

Parameters:
isFilter  
Return:
Object

_getCurrentSelectedItem

private static Object _getCurrentSelectedItem(Object contentNode)

Gets the current highlighted item. For keyboard purpose only. Also unsets the active-cell

Parameters:
contentNode  
Return:
Object

getDisplayedSuggestions

public AdfChainSuggestionsMap getDisplayedSuggestions()

Return:
AdfChainSuggestionsMap - the currently displayed suggestion objects

_getHighlightRegex

private static Object _getHighlightRegex(Object component)

Parameters:
component  
Return:
Object

_getHighlightTextWrapperHtml

private static Object _getHighlightTextWrapperHtml(Object component)

Parameters:
component  
Return:
Object

_getListItemContent

private static String _getListItemContent(Object data,
                                          Object matchRegex,
                                          Object replaceStr,
                                          Object template,
                                          Object templateAttributes)

Returns the client template based suggestion content for the suggestion data passed.

Parameters:
data  
matchRegex  
replaceStr  
template  
templateAttributes  
Return:
String - Mustache evaluated client template with the matching portion of the text wrapped in a span.

GetNextItem

protected static Object GetNextItem(Object component,
                                    Object isFindNextItem,
                                    Object currentItem)

Parameters:
component  
isFindNextItem  
currentItem  
Return:
Object

_getPartialSuggestionsLoadingIndicator

private static Object _getPartialSuggestionsLoadingIndicator(Object component)

Parameters:
component  
Return:
Object

GetPeer

protected Object GetPeer()

Return:
Object

GetSelectedItemTemplate

protected Object GetSelectedItemTemplate(Object template)

Parameters:
template  
Return:
Object

GetSelectedSampleListItem

protected Object GetSelectedSampleListItem(Object sampleListItem)

Modifies the a clone of sampleListItem as appropriate to use it for selected state

Parameters:
sampleListItem  
Return:
Object

getSuggestionElement

public static Object getSuggestionElement(Object element,
                                          HTMLElement rootElement)

Finds the closest ancestor element that is a suggestion item.

Parameters:
element  
rootElement - , the ancestor element lookup will only go up till the component's root element
Return:
Object

_getSuggestionsBody

private static Object _getSuggestionsBody(Object component)

Parameters:
component  
Return:
Object

getSuggestionsBodyId

public static Object getSuggestionsBodyId(Object component)

Parameters:
component  
Return:
Object

getSuggestItemIdPrefix

public static Object getSuggestItemIdPrefix(Object clientId)

Parameters:
clientId  
Return:
Object

_getTemplateAttributes

private Object _getTemplateAttributes()

Return:
Object

GetValueFromItem

protected static Object GetValueFromItem(Object component,
                                         Object suggestItem)

Parameters:
component  
suggestItem  
Return:
Object

_getWhitespacePreservedMatcher

private static Object _getWhitespacePreservedMatcher(Object contentNodeValue)

Parameters:
contentNodeValue  
Return:
Object

_getXthElement

private static Object _getXthElement(Object element,
                                     Object rowCount)

Parameters:
element  
rowCount  
Return:
Object

handleClick

public Object handleClick(Object eventTarget)

Parameters:
eventTarget  
Return:
Object

_handleEnterKey

private Object _handleEnterKey(Object component,
                               Object contentNode)

Parameters:
component  
contentNode  
Return:
Object

handleKeyDown

public Object handleKeyDown(Object componentEvent,
                            Object contentNode)

Parameters:
componentEvent  
contentNode  
Return:
Object

hasPartialDisplayedList

public static Object hasPartialDisplayedList(Object component)

Parameters:
component  
Return:
Object

Init

protected Object Init(Object peer)

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

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

InitClass

protected static Object InitClass()

Return:
Object

_initContentStampTemplate

private Object _initContentStampTemplate(Object component)

Parameters:
component  
Return:
Object

IsSelected

protected Object IsSelected(Object value)

Parameters:
value  
Return:
Object

_isSuggestionsPopupUpdated

private Object _isSuggestionsPopupUpdated(Object suggestions)

Parameters:
suggestions  
Return:
Object

IsSuggestItem

protected static Boolean IsSuggestItem(HTMLElement element)

Determine if the element is a suggest item

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

_manageSuggestionsPopupHeight

private Object _manageSuggestionsPopupHeight(Object suggestions)

Sets the height of the suggestions panel to display the first 'X' suggestion items as configured on the rowCount attribute of the component. Also initializes the scrollbar for virtual scrolling view

Parameters:
suggestions  
Return:
Object

_prepareTemplates

private Object _prepareTemplates(Object component)

Parameters:
component  
Return:
Object

removePartialSuggestionsLoadingIndicator

public static Boolean removePartialSuggestionsLoadingIndicator(AdfRichInputSearch component,
                                                               Object dontRemove)

Removes the partial suggestions list busy indicator if one is This busy indicator is added in a) While appending multiple search section in initial suggestion display b) While appending server filtered suggestions to client filtered suggestions

Parameters:
component  
dontRemove  
Return:
Boolean - true if busy indicator was present and hence removed

render

public Object render(Object component,
                     Object suggestions,
                     Object renderingContext)

Parameters:
component  
suggestions  
renderingContext  
Return:
Object

_renderNoSuggestionsMessage

private static Object _renderNoSuggestionsMessage(Object component,
                                                  Object isFiltering)

Parameters:
component  
isFiltering  
Return:
Object

_renderPartialSuggestionsList

private Object _renderPartialSuggestionsList(Object component,
                                             Object suggestions,
                                             Object renderingContext)

Parameters:
component  
suggestions  
renderingContext  
Return:
Object

_renderServerLoadingIndicator

private static Object _renderServerLoadingIndicator(Object component,
                                                    Object container)

Parameters:
component  
container  
Return:
Object

_selectNewItem

private Object _selectNewItem(AdfUIComponent component,
                              HTMLElement contentNode,
                              Boolean isFindNextItem)

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

Parameters:
component - The inputSearch component
contentNode - The editable input field
isFindNextItem - If true, next item is to be selected. Else, previous item is to be selected
Return:
Object

SelectSuggestItem

protected Object SelectSuggestItem(Object component,
                                   Object newValue,
                                   Object suggestionElem)

Parameters:
component  
newValue  
suggestionElem  
Return:
Object

_setDisplayedSuggestions

private Object _setDisplayedSuggestions(Object suggestions)

Parameters:
suggestions  
Return:
Object

_speakUpNewCell

private static Object _speakUpNewCell(Object component,
                                      Object contentNode,
                                      Object isNext)

Helps in cell navigation by changing aria-activedescendant property. Useful only for screenreader softwares and in table mode. There will no change in UI display. Initially the entire row is selected on pressing up/down arrow keys. The cell navigation is initiated only on pressing left/right arrow keys. The cell navigation is exited on pressing ENTER/Up/Down keys (via _getCurrentSelectedItem).

Parameters:
component  
contentNode  
isNext  
Return:
Object

update

public Object update(AdfRichInputSearch component,
                     AdfSuggestionMap suggestions,
                     Boolean isMasterList)

Invoked once the REST call is complete to update the rendered preferred suggestions with fresh data

Parameters:
component  
suggestions  
isMasterList  
Return:
Object

WrapContentHeaderTemplate

protected Object WrapContentHeaderTemplate(Object template)

Parameters:
template  
Return:
Object

WrapContentStampTemplate

protected Object WrapContentStampTemplate(Object component,
                                          Object template)

Parameters:
component  
template  
Return:
Object

WrapSectionHeaderTemplate

protected Object WrapSectionHeaderTemplate(Object component,
                                           Object section,
                                           Object template)

Parameters:
component  
section  
template  
Return:
Object

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

 

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.