Autocompleterpublic 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:
|
Fields Summary |
---|
public static final String | TEMPLATE | private static final String | COMPONENT_NAME | protected String | forceValidOption | protected String | searchType | protected String | autoComplete | protected String | delay | protected String | disabled | protected String | href | protected String | dropdownWidth | protected String | dropdownHeight | protected String | formId | protected String | formFilter | protected String | listenTopics | protected String | notifyTopics | protected String | indicator | protected String | loadOnTextChange | protected String | loadMinimumCount | protected String | showDownArrow | protected String | templateCssPath | protected String | iconPath | protected String | keyName | protected String | dataFieldName | protected String | resultsLimit |
Methods Summary |
---|
public void | evaluateExtraParams()
super.evaluateExtraParams();
if (forceValidOption != null)
addParameter("forceValidOption", findValue(forceValidOption,
Boolean.class));
if (searchType != null) {
String type = findString(searchType);
if(type != null)
addParameter("searchType", type.toUpperCase());
}
if (autoComplete != null)
addParameter("autoComplete", findValue(autoComplete, Boolean.class));
if (delay != null)
addParameter("delay", findValue(delay, Integer.class));
if (disabled != null)
addParameter("disabled", findValue(disabled, Boolean.class));
if (href != null) {
addParameter("href", findString(href));
addParameter("mode", "remote");
}
if (dropdownHeight != null)
addParameter("dropdownHeight", findValue(dropdownHeight, Integer.class));
if (dropdownWidth != null)
addParameter("dropdownWidth", findValue(dropdownWidth, Integer.class));
if (formFilter != null)
addParameter("formFilter", findString(formFilter));
if (formId != null)
addParameter("formId", findString(formId));
if (listenTopics != null)
addParameter("listenTopics", findString(listenTopics));
if (notifyTopics != null)
addParameter("notifyTopics", findString(notifyTopics));
if (indicator != null)
addParameter("indicator", findString(indicator));
if (loadOnTextChange != null)
addParameter("loadOnTextChange", findValue(loadOnTextChange, Boolean.class));
if (loadMinimumCount != null)
addParameter("loadMinimumCount", findValue(loadMinimumCount, Integer.class));
if (showDownArrow != null)
addParameter("showDownArrow", findValue(showDownArrow, Boolean.class));
else
addParameter("showDownArrow", Boolean.TRUE);
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
if(iconPath != null)
addParameter("iconPath", findString(iconPath));
if(dataFieldName != null)
addParameter("dataFieldName", findString(dataFieldName));
if(keyName != null)
addParameter("keyName", findString(keyName));
else {
keyName = name + "Key";
addParameter("keyName", findString(keyName));
}
String keyNameExpr = "%{" + keyName + "}";
addParameter("key", findString(keyNameExpr));
if(resultsLimit != null)
addParameter("searchLimit", findString(resultsLimit));
| protected java.lang.Object | findListValue()
return (list != null) ? findValue(list, Object.class) : null;
| public java.lang.String | getComponentName()
return COMPONENT_NAME;
| protected java.lang.String | getDefaultTemplate()
return TEMPLATE;
| public void | setAutoComplete(java.lang.String autoComplete)
this.autoComplete = autoComplete;
| public void | setDataFieldName(java.lang.String dataFieldName)
this.dataFieldName = dataFieldName;
| public void | setDelay(java.lang.String searchDelay)
this.delay = searchDelay;
| public void | setDisabled(java.lang.String disabled)
this.disabled = disabled;
| public void | setDropdownHeight(java.lang.String height)
this.dropdownHeight = height;
| public void | setDropdownWidth(java.lang.String width)
this.dropdownWidth = width;
| public void | setForceValidOption(java.lang.String forceValidOption)
this.forceValidOption = forceValidOption;
| public void | setFormFilter(java.lang.String formFilter)
this.formFilter = formFilter;
| public void | setFormId(java.lang.String formId)
this.formId = formId;
| public void | setHref(java.lang.String href)
this.href = href;
| public void | setIconPath(java.lang.String iconPath)
this.iconPath = iconPath;
| public void | setIndicator(java.lang.String indicator)
this.indicator = indicator;
| public void | setKeyName(java.lang.String keyName)
this.keyName = keyName;
| public void | setList(java.lang.String list)
super.setList(list);
| public void | setListenTopics(java.lang.String listenTopics)
this.listenTopics = listenTopics;
| public void | setLoadMinimumCount(java.lang.String loadMinimumCount)
this.loadMinimumCount = loadMinimumCount;
| public void | setLoadOnTextChange(java.lang.String loadOnType)
this.loadOnTextChange = loadOnType;
| public void | setNotifyTopics(java.lang.String onValueChangedPublishTopic)
this.notifyTopics = onValueChangedPublishTopic;
| public void | setResultsLimit(java.lang.String resultsLimit)
this.resultsLimit = resultsLimit;
| public void | setSearchType(java.lang.String searchType)
this.searchType = searchType;
| public void | setShowDownArrow(java.lang.String showDownArrow)
this.showDownArrow = showDownArrow;
| public void | setTemplateCssPath(java.lang.String templateCssPath)
this.templateCssPath = templateCssPath;
|
|