...
The autocompleter tag loads its options asynchronously when the page loads, and suggests options based on the text entered in the textbox. If the attribute "autoComplete" is set to "true" (defaults to false), the autocompleter will make suggestions in the textbox, as the user types. The autocompleter will always display a dropdown with the options that have at least a partial match with the text entered in the textbox. If the user clicks on the dropdown button, all the options will be shown in the dropdown. To force the value to be a valid option set the attribute "forceValidOption" to "true" ("false" by default).
Every autocompleter tag will generate two input fields, one of type "text", whose name is specified with the "name" attribute, and one of type "hidden" whose name is "${name}Key", where ${name} is the value in the "name" attribute. Given the following form:
Code Block | ||||
---|---|---|---|---|
| ||||
<s:url id="json" value="/JSONList.action" />
<form action="/someurl">
<s:autocompleter theme="ajax" href="%{json}" name="state"/>
<input type="submit">
</form>
|
When the form is submitted, the request will be something like: /someurl?state=Florida&stateKey=FL. "state" and "stateKey" must be defined as properties of the target action for the url.
Warning | ||
---|---|---|
| ||
Two properties must be defined on the target action for each autocompleter, one for the displayed text (its name is the value of the "name" attribute), and one for the key or value (its name is the value of the "name" attribute plus "Key"). |
Note | ||
---|---|---|
| ||
//TODO: add example here on how to use JSON Result Type |
...