Class UISuggest
java.lang.Object
javax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.apache.myfaces.tobago.internal.component.AbstractUISuggest
org.apache.myfaces.tobago.component.UISuggest
- All Implemented Interfaces:
EventListener
,javax.faces.component.behavior.ClientBehaviorHolder
,javax.faces.component.PartialStateHolder
,javax.faces.component.StateHolder
,javax.faces.event.ComponentSystemEventListener
,javax.faces.event.FacesListener
,javax.faces.event.SystemEventListenerHolder
,InputSuggest
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
FieldsFields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDelay()
Time in milli seconds before the list will be requested (by AJAX).TODO: not implemented yetThe maximum number of item to display in the drop down list.Minimum number of characters to type before the list will be requested.javax.el.MethodExpression
The real size of the result list.boolean
isUpdate()
TODO: not implemented yetvoid
restoreState
(javax.faces.context.FacesContext context, Object state) void
void
setFilter
(SuggestFilter filter) void
setMaximumItems
(Integer maximumItems) void
setMinimumCharacters
(Integer minimumCharacters) void
setSuggestMethodExpression
(javax.el.MethodExpression suggestMethod) void
setTotalCount
(Integer totalCount) void
setUpdate
(boolean update) Methods inherited from class org.apache.myfaces.tobago.internal.component.AbstractUISuggest
getQuery, setQuery
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, initialStateMarked, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, visitTree
Methods inherited from class javax.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.faces.component.behavior.ClientBehaviorHolder
addClientBehavior, getClientBehaviors, getDefaultEventName, getEventNames
-
Field Details
-
COMPONENT_TYPE
-
COMPONENT_FAMILY
- See Also:
-
-
Constructor Details
-
UISuggest
public UISuggest()
-
-
Method Details
-
getFamily
- Overrides:
getFamily
in classAbstractUISuggest
-
getFilter
TODO: not implemented yetAdditional 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:SuggestFilter.ALL
Allowed Values:all,prefix,contains
-
setFilter
- Specified by:
setFilter
in classAbstractUISuggest
-
getDelay
Time in milli seconds before the list will be requested (by AJAX).
Default:200
- Specified by:
getDelay
in classAbstractUISuggest
-
setDelay
- Specified by:
setDelay
in classAbstractUISuggest
-
getSuggestMethodExpression
public javax.el.MethodExpression getSuggestMethodExpression() -
setSuggestMethodExpression
public void setSuggestMethodExpression(javax.el.MethodExpression suggestMethod) -
getMinimumCharacters
Minimum number of characters to type before the list will be requested. If the value is 0, there will be send an initial list to the client. So, if you setupdate="false"
this value should be 0.
Default:1
- Specified by:
getMinimumCharacters
in classAbstractUISuggest
-
setMinimumCharacters
- Specified by:
setMinimumCharacters
in classAbstractUISuggest
-
isUpdate
public boolean isUpdate()TODO: not implemented yetShould the list be updated while typing (via AJAX). This is the default behaviour. If you set this value to
false
, please set theminimumCharacters="0"
.
Default:true
- Specified by:
isUpdate
in classAbstractUISuggest
-
setUpdate
public void setUpdate(boolean update) -
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:
getTotalCount
in classAbstractUISuggest
-
setTotalCount
-
getMaximumItems
The maximum number of item to display in the drop down list.
Default:10
- Specified by:
getMaximumItems
in classAbstractUISuggest
-
setMaximumItems
-
restoreState
- Specified by:
restoreState
in interfacejavax.faces.component.StateHolder
- Overrides:
restoreState
in classjavax.faces.component.UIComponentBase
-