Class UISuggest
- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- org.apache.myfaces.tobago.internal.component.AbstractUISuggest
-
- org.apache.myfaces.tobago.component.UISuggest
-
- All Implemented Interfaces:
jakarta.faces.component.behavior.ClientBehaviorHolder
,jakarta.faces.component.PartialStateHolder
,jakarta.faces.component.StateHolder
,jakarta.faces.component.TransientStateHolder
,jakarta.faces.event.ComponentSystemEventListener
,jakarta.faces.event.FacesListener
,jakarta.faces.event.SystemEventListenerHolder
,EventListener
@Generated("component.stg") public class UISuggest extends AbstractUISuggest
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 classSuggestTagDeclaration
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_FAMILY
static String
COMPONENT_TYPE
-
Constructor Summary
Constructors Constructor Description UISuggest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getDelay()
Time in milliseconds before the list will be requested (by AJAX).String
getFamily()
SuggestFilter
getFilter()
Additional client side filtering of the result list.Integer
getMaximumItems()
The maximum number of item to display in the drop-down list.Integer
getMinimumCharacters()
Minimum number of characters to type before the list will be requested.Integer
getTotalCount()
The real size of the result list.boolean
isLocalMenu()
If a suggest menu is available, it will be rendered on the component, not in the '.tobago-page-menuStore'.boolean
isUpdate()
Should the list be updated while typing (via AJAX).void
restoreState(jakarta.faces.context.FacesContext context, Object state)
void
setDelay(Integer delay)
void
setFilter(SuggestFilter filter)
void
setLocalMenu(boolean localMenu)
void
setMaximumItems(Integer maximumItems)
void
setMinimumCharacters(Integer minimumCharacters)
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 jakarta.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, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, visitTree
-
Methods inherited from class jakarta.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
-
-
-
-
Field Detail
-
COMPONENT_TYPE
public static final String COMPONENT_TYPE
-
COMPONENT_FAMILY
public static final String COMPONENT_FAMILY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFamily
public String getFamily()
- Overrides:
getFamily
in classAbstractUISuggest
-
getFilter
public SuggestFilter 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:
getFilter
in classAbstractUISuggest
-
setFilter
public void setFilter(SuggestFilter filter)
- Specified by:
setFilter
in classAbstractUISuggest
-
getDelay
public Integer getDelay()
Time in milliseconds before the list will be requested (by AJAX).
Default:200
- Specified by:
getDelay
in classAbstractUISuggest
-
setDelay
public void setDelay(Integer delay)
- Specified by:
setDelay
in classAbstractUISuggest
-
getMinimumCharacters
public Integer 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:
getMinimumCharacters
in classAbstractUISuggest
-
setMinimumCharacters
public void setMinimumCharacters(Integer minimumCharacters)
- Specified by:
setMinimumCharacters
in classAbstractUISuggest
-
isUpdate
public boolean isUpdate()
Should the list be updated while typing (via AJAX). This is the default behavior.
Default:true
- Specified by:
isUpdate
in classAbstractUISuggest
-
setUpdate
public void setUpdate(boolean update)
-
getTotalCount
public Integer 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
public void setTotalCount(Integer totalCount)
-
isLocalMenu
public boolean isLocalMenu()
If a suggest menu is available, it will be rendered on the component, not in the '.tobago-page-menuStore'.
Default:false
- Specified by:
isLocalMenu
in classAbstractUISuggest
-
setLocalMenu
public void setLocalMenu(boolean localMenu)
-
getMaximumItems
public Integer getMaximumItems()
The maximum number of item to display in the drop-down list.
Default:10
- Specified by:
getMaximumItems
in classAbstractUISuggest
-
setMaximumItems
public void setMaximumItems(Integer maximumItems)
-
restoreState
public void restoreState(jakarta.faces.context.FacesContext context, Object state)
- Specified by:
restoreState
in interfacejakarta.faces.component.StateHolder
- Overrides:
restoreState
in classjakarta.faces.component.UIComponentBase
-
-