I am intending to display a list of suggestions for a textbox using sj:autocompleter
. When I hard code the data in the jsp it works fine.
<sj:autocompleter name="fruitNames"
list="{'apple', 'banana', 'orange', 'apricot'}"
label="Fruit Names">
</sj:autocompleter>
But I want to get the list of suggestions dynamically from the action class. I tried doing this but it is not getting the values.
<sj:autocompleter name="fruitNames" list="fruitslist"
label="Fruit Names">
</sj:autocompleter>
In my action class,
public String execute() {
fruitslist= new ArrayList<String>();
fruitslist.add("Apple");
fruitslist.add("Banana");
fruitslist.add("Orange");
fruitslist.add("Apricot");
}
Please help.