【问题标题】:Richfaces - <rich:autocomplete> not showing suggestionsRichfaces - <rich:autocomplete> 不显示建议
【发布时间】:2014-04-29 22:49:55
【问题描述】:

我遇到了自动完成不显示建议的问题。不知道我错过了什么。代码:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich">
  <h:head />
  <h:body>
    <h:form>
      <rich:autocomplete autocompleteMethod="#{myBean.autocomplete}" var="item">
    <h:outputText value="#{item}" />
      </rich:autocomplete>
    </h:form>
  </h:body>
</html>

@ManagedBean
@SessionScoped
public class MyBean {
    public List<String> autocomplete(FacesContext ctx, UIComponent c, String prefix) {
        return Arrays.asList(new String[] {"foo", "bar", "baz"});
    }
}

当我键入时调用 bean 方法,我可以在浏览器控制台中看到 AJAX POST 返回结果:

<!-- ... snip ... -->
<componentData>{"j_idt5:j_idt6":["for","bar","baz"] }</componentData>

但是建议不会显示。有什么想法吗?

使用 JBoss WildFly 8 上部署的 JSF 2 和 Richfaces 4.3.4。

【问题讨论】:

    标签: jsf jsf-2 richfaces


    【解决方案1】:

    原来这是一个已知问题 (RF-13587)。它可以通过使用 JSF 版本 2.1.25 来解决,如下所述:

    RichFaces 4 autocomplete is not showing suggestions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多