diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Autocompleter.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Autocompleter.java index 4b1621978..ffd9e000a 100644 --- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Autocompleter.java +++ b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Autocompleter.java @@ -92,42 +92,33 @@ import com.opensymphony.xwork2.util.ValueStack; *
Examples
* *Autocompleter that gets its list from an action:
- *
* <sx:autocompleter name="autocompleter1" href="%{jsonList}"/>
- *
*
*
*
* Autocompleter that uses a list:
- *
* <s:autocompleter name="test" list="{'apple','banana','grape','pear'}" autoComplete="false"/>
- *
*
*
*
* Autocompleter that reloads its content everytime the text changes (and the length of the text is greater than 3):
- *
* <sx:autocompleter name="mvc" href="%{jsonList}" loadOnTextChange="true" loadMinimumCount="3"/>
*
* The text entered on the autocompleter is passed as a parameter to the url specified in "href", like (text is "struts"):
*
* http://host/example/myaction.do?mvc=struts
- *
*
*
*
* Linking two autocompleters:
- *
* <form id="selectForm">
* <sx:autocompleter name="select" list="{'fruits','colors'}" valueNotifyTopics="/changed" />
* </form>
* <sx:autocompleter href="%{jsonList}" formId="selectForm" listenTopics="/changed"/>
- *
*
*
*
* Set/Get selected values using JavaScript
- *
* <sx:autocompleter href="%{jsonList}" id="auto"/>
* <script type="text/javascript">
* function getValues() {
@@ -156,12 +147,10 @@ import com.opensymphony.xwork2.util.ValueStack;
* autoCompleter.setAllValues("AL", "Alabama");
* }
* </script>
- *
*
*
*
* Using beforeNotifyTopics:
- *
* <script type="text/javascript">
* dojo.event.topic.subscribe("/before", function(event, widget){
* alert('inside a topic event. before request');
@@ -171,12 +160,10 @@ import com.opensymphony.xwork2.util.ValueStack;
* </script>
*
* <sx:autocompleter beforeNotifyTopics="/before" href="%{#ajaxTest} />
- *
*
*
*
* Using afterNotifyTopics:
- *
* <script type="text/javascript">
* dojo.event.topic.subscribe("/after", function(data, request, widget){
* alert('inside a topic event. after request');
@@ -187,12 +174,10 @@ import com.opensymphony.xwork2.util.ValueStack;
* </script>
*
* <sx:autocompleter afterNotifyTopics="/after" href="%{#ajaxTest}" />
- *
*
*
*
* Using errorNotifyTopics:
- *
* <script type="text/javascript">
* dojo.event.topic.subscribe("/error", function(error, request, widget){
* alert('inside a topic event. on error');
@@ -203,12 +188,10 @@ import com.opensymphony.xwork2.util.ValueStack;
* </script>
*
* <sx:autocompleter errorNotifyTopics="/error" href="%{#ajaxTest}" />
- *
*
*
*
* Using valueNotifyTopics and indicator:
- *
* <script type="text/javascript">
* dojo.event.topic.subscribe("/value", function(value, key, text, widget){
* alert('inside a topic event. after value changed');
@@ -218,7 +201,8 @@ import com.opensymphony.xwork2.util.ValueStack;
* //widget: widget that published the topic
* });
* </script>
- *
+ *
+ * <sx:autocompleter valueNotifyTopics="/value" href="%{#ajaxTest}" />
*
*/
@StrutsTag(name="autocompleter", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.AutocompleterTag", description="Renders a combobox with autocomplete and AJAX capabilities")