struts 2 autocompleter
<ajax:autocompleter name="cityName" list="list" size="1" label="Select City"
listValue="cityName" listKey="id" autoComplete="true"></ajax:autocompleter>
i am using struts 2 with ajax but its not开发者_Python百科 working
<%@ taglib prefix="ajax" uri="/struts-dojo-tags"%>
**<ajax:head />**
<ajax:autocompleter name="cityName" list="list" size="1" label="Select City"
listValue="cityName" listKey="id" autoComplete="true"></ajax:autocompleter>
Make sure <ajax:head/> is in the <head></head> of the jsp. It generates the required code for autogeneration.
you should use struts url tag to call an action which gives u json object as list
<s:url id="List" action="/actionName" method="methodName" />
<sx:autocompleter id="itemC" href="%{List}" forceValidOption="true" preload="true"
size="24" name="item" autoComplete="false" showDownArrow="false"
valueNotifyTopics="/value"></sx:autocompleter>
精彩评论