javajspstruts2strutsstruts2-jquery

Struts 2 autocompleter not working as dropdown


I have a JSP page in which I have use sx:autocompleter. It is working but at the time of typing in textbox, suggestions are not coming in dropdown, they are coming as completing the word. Like this

What is the problem here ?

enter image description here


Solution

  • Use <sj:autocompleter> instead.

    The Autocompleter widget renders a HTML input or select box with.

    <%@ taglib prefix="s" uri="/struts-tags"%>
    <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
    <html>
      <head>
        <sj:head jqueryui="true"/>
      </head>
      <body>
        <sj:autocompleter
                id="customers"
                name="echo"
                list="%{customers}"
                listValue="name"
                listKey="id"
                selectBox="true"
        />
      </body>
    </html>