org.apache.struts2.components
Class Autocompleter
java.lang.Object
org.apache.struts2.components.Component
org.apache.struts2.components.UIBean
org.apache.struts2.components.TextField
org.apache.struts2.components.ComboBox
org.apache.struts2.components.Autocompleter
public class Autocompleter
- extends ComboBox
The autocomplete tag is a combobox that can autocomplete text entered on the input box.
When used on the "simple" theme, the autocompleter can be used like the ComboBox.
When used on the "ajax" theme, the list can be retieved from an action.
THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED
- href
- errorText
- listenTopics
- notifyTopics
- listenTopics
- formId
- formFilter
- indicator
- loadOnTextChange
- loadMinimumCount
- showDownArrow
- searchType
'dropdownWidth' width in pixels of the drodpdown, same as autocompleter's width by default
'dropdownHeight' height in pixels of the drodown, 120 px by default
'forceValidOption' if invalid option is selected, clear autocompleter's text when focus is lost
'autoComplete', if true, make suggestions on the textbox
'formId' is the id of the html form whose fields will be seralized and passed as parameters
in the request.
'formFilter' is the name of a function which will be used to filter the fields that will be
seralized. This function takes as a parameter the element and returns true if the element
should be included.
'listenTopics' comma separated list of topics names, that will trigger a request
'indicator' element to be shown while the request executing
'showErrorTransportText': whether errors should be displayed (on 'targets')
'loadOnTextChange' options will be reloaded everytime a character is typed on the textbox
'loadMinimumCount' minimum number of characters that will force the content to be loaded
'showDownError' show or hide the down arrow button
'searchType' how the search must be performed, options are: "startstring", "startword" and "substring"
'keyName' name of the field to which the selected key will be assigned
'iconPath' path of icon used for the dropdown
'templateCssPath' path to css file used to customize Dojo's widget
'dataFieldName' name of the field to be used as the list in the returned JSON string
'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:
public static final String TEMPLATE
- See Also:
- Constant Field Values
COMPONENT_NAME
private static final String COMPONENT_NAME
forceValidOption
protected String forceValidOption
searchType
protected String searchType
autoComplete
protected String autoComplete
delay
protected String delay
disabled
protected String disabled
href
protected String href
dropdownWidth
protected String dropdownWidth
dropdownHeight
protected String dropdownHeight
formId
protected String formId
formFilter
protected String formFilter
listenTopics
protected String listenTopics
notifyTopics
protected String notifyTopics
indicator
protected String indicator
loadOnTextChange
protected String loadOnTextChange
loadMinimumCount
protected String loadMinimumCount
showDownArrow
protected String showDownArrow
templateCssPath
protected String templateCssPath
iconPath
protected String iconPath
keyName
protected String keyName
dataFieldName
protected String dataFieldName
resultsLimit
protected String resultsLimit
Autocompleter
public Autocompleter(ValueStack stack,
HttpServletRequest request,
HttpServletResponse response)
getDefaultTemplate
protected String getDefaultTemplate()
- Description copied from class:
UIBean
- A contract that requires each concrete UI Tag to specify which template should be used as a default. For
example, the CheckboxTab might return "checkbox.vm" while the RadioTag might return "radio.vm". This value
not begin with a '/' unless you intend to make the path absolute rather than relative to the
current theme.
- Overrides:
getDefaultTemplate
in class ComboBox
- Returns:
- The name of the template to be used as the default.
getComponentName
public String getComponentName()
evaluateExtraParams
public void evaluateExtraParams()
- Overrides:
evaluateExtraParams
in class ComboBox
findListValue
protected Object findListValue()
- Overrides:
findListValue
in class ComboBox
setAutoComplete
public void setAutoComplete(String autoComplete)
setDisabled
public void setDisabled(String disabled)
- Overrides:
setDisabled
in class UIBean
setForceValidOption
public void setForceValidOption(String forceValidOption)
setHref
public void setHref(String href)
setDelay
public void setDelay(String searchDelay)
setSearchType
public void setSearchType(String searchType)
setDropdownHeight
public void setDropdownHeight(String height)
setDropdownWidth
public void setDropdownWidth(String width)
setFormFilter
public void setFormFilter(String formFilter)
setFormId
public void setFormId(String formId)
setListenTopics
public void setListenTopics(String listenTopics)
setNotifyTopics
public void setNotifyTopics(String onValueChangedPublishTopic)
setIndicator
public void setIndicator(String indicator)
setLoadMinimumCount
public void setLoadMinimumCount(String loadMinimumCount)
setLoadOnTextChange
public void setLoadOnTextChange(String loadOnType)
setShowDownArrow
public void setShowDownArrow(String showDownArrow)
setList
public void setList(String list)
- Overrides:
setList
in class ComboBox
setTemplateCssPath
public void setTemplateCssPath(String templateCssPath)
setIconPath
public void setIconPath(String iconPath)
setKeyName
public void setKeyName(String keyName)
setDataFieldName
public void setDataFieldName(String dataFieldName)
setResultsLimit
public void setResultsLimit(String resultsLimit)
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.