Class UISuggest
java.lang.Object
org.apache.myfaces.tobago.internal.component.AbstractUISuggest
org.apache.myfaces.tobago.component.UISuggest
- All Implemented Interfaces:
EventListener
Renders a list of suggested texts for a given input field.
Basic features:
- provide a list directly while rendering (not AJAX needed) [todo]
- update by typing (AJAX)
- minimum number of typed characters (to avoid useless requests)
- update delay (useful for optimization)
- filter on client side (useful for optimization) [todo]
component.stg with class
SuggestTagDeclaration.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientBehavior(String arg0, jakarta.faces.component.behavior.ClientBehavior arg1) voidaddClientBehavior(String arg0, jakarta.faces.component.behavior.ClientBehavior arg1) protected voidaddFacesListener(jakarta.faces.event.FacesListener arg0) voidbroadcast(jakarta.faces.event.FacesEvent arg0) voidvoiddecode(jakarta.faces.context.FacesContext arg0) voidencodeAll(jakarta.faces.context.FacesContext arg0) voidencodeBegin(jakarta.faces.context.FacesContext arg0) voidencodeChildren(jakarta.faces.context.FacesContext arg0) voidencodeEnd(jakarta.faces.context.FacesContext arg0) jakarta.faces.component.UIComponentfindComponent(String arg0) intList<jakarta.faces.component.UIComponent> getClientId(jakarta.faces.context.FacesContext arg0) static jakarta.faces.component.UIComponentgetCompositeComponentParent(jakarta.faces.component.UIComponent arg0) getContainerClientId(jakarta.faces.context.FacesContext arg0) static jakarta.faces.component.UIComponentgetCurrentComponent(jakarta.faces.context.FacesContext arg0) static jakarta.faces.component.UIComponentgetCurrentCompositeComponent(jakarta.faces.context.FacesContext arg0) getDelay()Time in milliseconds before the list will be requested (by AJAX).protected jakarta.faces.context.FacesContextprotected jakarta.faces.event.FacesListener[]getFacesListeners(Class arg0) jakarta.faces.component.UIComponentintIterator<jakarta.faces.component.UIComponent> Additional client side filtering of the result list.getId()List<jakarta.faces.event.SystemEventListener> getListenersForEventClass(Class<? extends jakarta.faces.event.SystemEvent> arg0) The maximum number of item to display in the drop-down list.Minimum number of characters to type before the list will be requested.jakarta.faces.component.UIComponentjakarta.faces.component.UIComponentgetPassThroughAttributes(boolean arg0) protected jakarta.faces.render.RenderergetRenderer(jakarta.faces.context.FacesContext arg0) booleanprotected jakarta.faces.component.StateHelperprotected jakarta.faces.component.StateHelpergetStateHelper(boolean arg0) The real size of the result list.jakarta.faces.component.TransientStateHelperjakarta.faces.component.TransientStateHelpergetTransientStateHelper(boolean arg0) jakarta.el.ValueExpressiongetValueExpression(String arg0) booleanbooleaninvokeOnComponent(jakarta.faces.context.FacesContext arg0, String arg1, jakarta.faces.component.ContextCallback arg2) static booleanisCompositeComponent(jakarta.faces.component.UIComponent arg0) booleanisInView()booleanBy default, dropdown menus are rendered in the '.tobago-page-menuStore'.booleanbooleanbooleanisUpdate()Should the list be updated while typing (via AJAX).protected booleanisVisitable(jakarta.faces.component.visit.VisitContext arg0) voidvoidpopComponentFromEL(jakarta.faces.context.FacesContext arg0) voidprocessDecodes(jakarta.faces.context.FacesContext arg0) voidprocessEvent(jakarta.faces.event.ComponentSystemEvent arg0) voidprocessRestoreState(jakarta.faces.context.FacesContext arg0, Object arg1) processSaveState(jakarta.faces.context.FacesContext arg0) voidprocessUpdates(jakarta.faces.context.FacesContext arg0) voidprocessValidators(jakarta.faces.context.FacesContext arg0) voidpushComponentToEL(jakarta.faces.context.FacesContext arg0, jakarta.faces.component.UIComponent arg1) voidqueueEvent(jakarta.faces.event.FacesEvent arg0) protected voidremoveFacesListener(jakarta.faces.event.FacesListener arg0) static ObjectrestoreAttachedState(jakarta.faces.context.FacesContext arg0, Object arg1) voidrestoreState(jakarta.faces.context.FacesContext context, Object state) voidrestoreTransientState(jakarta.faces.context.FacesContext arg0, Object arg1) static ObjectsaveAttachedState(jakarta.faces.context.FacesContext arg0, Object arg1) saveState(jakarta.faces.context.FacesContext arg0) saveTransientState(jakarta.faces.context.FacesContext arg0) voidvoidsetFilter(SuggestFilter filter) voidvoidsetInView(boolean arg0) voidsetLocalMenu(boolean localMenu) voidsetMaximumItems(Integer maximumItems) voidsetMinimumCharacters(Integer minimumCharacters) voidsetParent(jakarta.faces.component.UIComponent arg0) voidsetRendered(boolean arg0) voidsetRendererType(String arg0) voidsetTotalCount(Integer totalCount) voidsetTransient(boolean arg0) voidsetUpdate(boolean update) voidsetValueExpression(String arg0, jakarta.el.ValueExpression arg1) voidsubscribeToEvent(Class<? extends jakarta.faces.event.SystemEvent> arg0, jakarta.faces.event.ComponentSystemEventListener arg1) voidunsubscribeFromEvent(Class<? extends jakarta.faces.event.SystemEvent> arg0, jakarta.faces.event.ComponentSystemEventListener arg1) booleanvisitTree(jakarta.faces.component.visit.VisitContext arg0, jakarta.faces.component.visit.VisitCallback arg1) Methods inherited from class AbstractUISuggest
getQuery, setQuery
-
Field Details
-
COMPONENT_TYPE
-
COMPONENT_FAMILY
- See Also:
-
BEANINFO_KEY
- See Also:
-
COMPOSITE_COMPONENT_TYPE_KEY
- See Also:
-
COMPOSITE_FACET_NAME
- See Also:
-
FACETS_KEY
- See Also:
-
VIEW_LOCATION_KEY
- See Also:
-
ATTRS_WITH_DECLARED_DEFAULT_VALUES
- See Also:
-
bindings
Deprecated.
-
-
Constructor Details
-
UISuggest
public UISuggest()
-
-
Method Details
-
getFamily
- Overrides:
getFamilyin classAbstractUISuggest
-
getFilter
Additional client side filtering of the result list. This is useful when sending the full list initially to the client and setting
update=false.Possible values are:
- all
- no filtering
- prefix
- checks if the suggested string starts with the typed text
- contains
- checks if the typed text is inside of the suggested string
The filter will only applied on the client side and only if server updated (by AJAX) are turned off (
update=false);
Default:contains
Allowed Values:all,prefix,contains- Specified by:
getFilterin classAbstractUISuggest
-
setFilter
- Specified by:
setFilterin classAbstractUISuggest
-
getDelay
Time in milliseconds before the list will be requested (by AJAX).
Default:200- Specified by:
getDelayin classAbstractUISuggest
-
setDelay
- Specified by:
setDelayin classAbstractUISuggest
-
getMinimumCharacters
Minimum number of characters to type before the list will be requested. If the value is 0, there will be sent an initial list to the client. So, if you setupdate="false"
this value should be 0.
Default:1- Specified by:
getMinimumCharactersin classAbstractUISuggest
-
setMinimumCharacters
- Specified by:
setMinimumCharactersin classAbstractUISuggest
-
isUpdate
public boolean isUpdate()Should the list be updated while typing (via AJAX). This is the default behavior.
Default:true- Specified by:
isUpdatein classAbstractUISuggest
-
setUpdate
public void setUpdate(boolean update) -
isLocalMenu
public boolean isLocalMenu()By default, dropdown menus are rendered in the '.tobago-page-menuStore'. If localMenu=true, the dropdown menu is rendered on the component.
Default:false- Specified by:
isLocalMenuin classAbstractUISuggest
-
setLocalMenu
public void setLocalMenu(boolean localMenu) -
getTotalCount
The real size of the result list. Typically, the result list will be cropped (in the backend) to save memory. This value can be set, to show the user there are more results for the given string. If the value is -1, no hint will be displayed.
Default:-1- Specified by:
getTotalCountin classAbstractUISuggest
-
setTotalCount
-
getMaximumItems
The maximum number of item to display in the drop-down list.
Default:10- Specified by:
getMaximumItemsin classAbstractUISuggest
-
setMaximumItems
-
restoreState
-
addClientBehavior
-
getClientBehaviors
-
getDefaultEventName
String getDefaultEventName() -
getEventNames
Collection<String> getEventNames() -
setId
-
setParent
public void setParent(jakarta.faces.component.UIComponent arg0) -
addClientBehavior
-
broadcast
public void broadcast(jakarta.faces.event.FacesEvent arg0) throws jakarta.faces.event.AbortProcessingException - Throws:
jakarta.faces.event.AbortProcessingException
-
clearInitialState
public void clearInitialState() -
decode
public void decode(jakarta.faces.context.FacesContext arg0) -
encodeAll
- Throws:
IOException
-
encodeBegin
- Throws:
IOException
-
encodeChildren
- Throws:
IOException
-
encodeEnd
- Throws:
IOException
-
findComponent
-
getAttributes
-
getPassThroughAttributes
-
getChildCount
public int getChildCount() -
getChildren
-
getClientBehaviors
-
getClientId
-
getDefaultEventName
-
getEventNames
-
getFacet
-
getFacetCount
public int getFacetCount() -
getFacets
-
getFacetsAndChildren
-
getId
-
getParent
public jakarta.faces.component.UIComponent getParent() -
getRendererType
-
getRendersChildren
public boolean getRendersChildren() -
invokeOnComponent
public boolean invokeOnComponent(jakarta.faces.context.FacesContext arg0, String arg1, jakarta.faces.component.ContextCallback arg2) throws jakarta.faces.FacesException - Throws:
jakarta.faces.FacesException
-
visitTree
public boolean visitTree(jakarta.faces.component.visit.VisitContext arg0, jakarta.faces.component.visit.VisitCallback arg1) -
isRendered
public boolean isRendered() -
isTransient
public boolean isTransient() -
markInitialState
public void markInitialState() -
addFacesListener
protected void addFacesListener(jakarta.faces.event.FacesListener arg0) -
getFacesContext
protected jakarta.faces.context.FacesContext getFacesContext() -
getFacesListeners
-
getRenderer
protected jakarta.faces.render.Renderer getRenderer(jakarta.faces.context.FacesContext arg0) -
removeFacesListener
protected void removeFacesListener(jakarta.faces.event.FacesListener arg0) -
queueEvent
public void queueEvent(jakarta.faces.event.FacesEvent arg0) -
processDecodes
public void processDecodes(jakarta.faces.context.FacesContext arg0) -
processValidators
public void processValidators(jakarta.faces.context.FacesContext arg0) -
processUpdates
public void processUpdates(jakarta.faces.context.FacesContext arg0) -
processSaveState
-
processRestoreState
-
setTransient
public void setTransient(boolean arg0) -
saveAttachedState
-
restoreAttachedState
public static Object restoreAttachedState(jakarta.faces.context.FacesContext arg0, Object arg1) throws IllegalStateException - Throws:
IllegalStateException
-
saveState
-
setRendered
public void setRendered(boolean arg0) -
setRendererType
-
getPassThroughAttributes
-
initialStateMarked
public boolean initialStateMarked() -
isCompositeComponent
public static boolean isCompositeComponent(jakarta.faces.component.UIComponent arg0) -
isInView
public boolean isInView() -
isVisitable
protected boolean isVisitable(jakarta.faces.component.visit.VisitContext arg0) -
setValueExpression
-
getClientId
-
getCompositeComponentParent
public static jakarta.faces.component.UIComponent getCompositeComponentParent(jakarta.faces.component.UIComponent arg0) -
getContainerClientId
-
getCurrentComponent
public static jakarta.faces.component.UIComponent getCurrentComponent(jakarta.faces.context.FacesContext arg0) -
getCurrentCompositeComponent
public static jakarta.faces.component.UIComponent getCurrentCompositeComponent(jakarta.faces.context.FacesContext arg0) -
getListenersForEventClass
-
getNamingContainer
public jakarta.faces.component.UIComponent getNamingContainer() -
setInView
public void setInView(boolean arg0) -
getResourceBundleMap
-
getValueExpression
-
processEvent
public void processEvent(jakarta.faces.event.ComponentSystemEvent arg0) throws jakarta.faces.event.AbortProcessingException - Throws:
jakarta.faces.event.AbortProcessingException
-
subscribeToEvent
public void subscribeToEvent(Class<? extends jakarta.faces.event.SystemEvent> arg0, jakarta.faces.event.ComponentSystemEventListener arg1) -
unsubscribeFromEvent
public void unsubscribeFromEvent(Class<? extends jakarta.faces.event.SystemEvent> arg0, jakarta.faces.event.ComponentSystemEventListener arg1) -
getStateHelper
protected jakarta.faces.component.StateHelper getStateHelper() -
getStateHelper
protected jakarta.faces.component.StateHelper getStateHelper(boolean arg0) -
getTransientStateHelper
public jakarta.faces.component.TransientStateHelper getTransientStateHelper() -
getTransientStateHelper
public jakarta.faces.component.TransientStateHelper getTransientStateHelper(boolean arg0) -
restoreTransientState
-
saveTransientState
-
popComponentFromEL
public void popComponentFromEL(jakarta.faces.context.FacesContext arg0) -
pushComponentToEL
public void pushComponentToEL(jakarta.faces.context.FacesContext arg0, jakarta.faces.component.UIComponent arg1)
-