From 79ee4c384534f6bacd2338124209bda0f7f4b27a Mon Sep 17 00:00:00 2001 From: Musachy Barroso Date: Fri, 23 Feb 2007 01:06:19 +0000 Subject: [PATCH] WW-1659: * Update autocompleter to accept JSON generated using the JSON plugin * Add "dataFieldName" to identify the field to be used as the data source in the returned JSON string git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@510743 13f79535-47bb-0310-9956-ffa450edef68 --- .../struts2/components/Autocompleter.java | 19 +++++----- .../views/jsp/ui/AutocompleterTag.java | 6 ++++ .../static/dojo/struts/widget/ComboBox.js | 36 +++++++++++++++---- .../resources/template/ajax/autocompleter.ftl | 3 ++ .../site/resources/tags/autocompleter.html | 8 +++++ .../views/jsp/ui/AutocompleterTest.java | 1 + .../struts2/views/jsp/ui/Autocompleter-1.txt | 3 +- 7 files changed, 60 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/components/Autocompleter.java b/core/src/main/java/org/apache/struts2/components/Autocompleter.java index 3753a8e86..85c5ee38e 100644 --- a/core/src/main/java/org/apache/struts2/components/Autocompleter.java +++ b/core/src/main/java/org/apache/struts2/components/Autocompleter.java @@ -31,15 +31,7 @@ import com.opensymphony.xwork2.util.ValueStack; /** *

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. This action must - * return a JSON list in the format:

- *
- * [
- *   ["Text 1","Value1"],
- *   ["Text 2","Value2"],
- *   ["Text 3","Value3"]
- * ]
- * 
+ * When used on the "ajax" theme, the list can be retieved from an action.

* * THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED *