簡體   English   中英

Primefaces使用forceSelection false自動完成多個

[英]Primefaces autocomplete multiple with forceSelection false

我使用的是Primefaces 6.0,其中<p:autocomplete>不適用於multiple=trueforceSelection=false

您可以在下面找到組件:

 <p:autoComplete value="#{bean.value} 
      multiple="true"
      completeMethod="#{bean.completeTheme}"
      forceSelection="false"/>

如何插入未列出的自定義值?

您始終可以在完整的方法中添加插入的自定義值,如下所示:

public List<String> completeMethod(String query) {
    List<String> suggestions = new ArrayList();
    suggestions.add(query);

    //... add more suggestions
    return suggestions;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM