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 2ef1b1dd3..6858051f0 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 @@ -42,12 +42,19 @@ import com.opensymphony.xwork2.util.ValueStack; * ["Text2", "Value2"] * ] * - *
2. If a value is specified in the "dataFieldName" attribute, and the response has a field with that - * name, assume that's the datasource, which can be an array of 2-dimension array elements, or a map, - * like (assuming dataFieldName="states"):
+ *2. If the response is a map, use it (recommended as it is the easiest one to generate): *
* {
- * "states" : [
+ * "Alabama" : "AL",
+ * "Alaska" : "AL"
+ * }
+ *
+ * 3. If a value is specified in the "dataFieldName" attribute, and the response has a field with that + * name, assume that's the datasource, which can be an array of 2-dimension array elements, or a map, + * like (assuming dataFieldName="state"):
+ *
+ * {
+ * "state" : [
* ["Alabama","AL"],
* ["Alaska","AK"]
* ]
@@ -56,7 +63,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* or
*
* {
- * "states" : {
+ * "state" : {
* "Alabama" : "AL",
* "Alaska" : "AK"
* }