Struts 2 自动完成器不能作为下拉菜单工作

问题描述 投票:0回答:1

我有一个 JSP 页面,我在其中使用了

sx:autocompleter
。它正在工作,但在文本框中输入时,建议不会出现在下拉列表中,而是会作为完成单词出现。像这样

这里有什么问题?

enter image description here

java jsp struts2 struts struts2-jquery
1个回答
2
投票

请使用

sj:autocompleter
来代替。

自动完成器小部件呈现 HTML 输入或选择框。

<%@ 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>
© www.soinside.com 2019 - 2024. All rights reserved.