Primefaces 使用 forceSelection false 自动完成多个
Primefaces autocomplete multiple with forceSelection false
我正在使用 Primefaces 6.0,其中 <p:autocomplete>
不适用于 multiple=true
并且forceSelection=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;
}
我正在使用 Primefaces 6.0,其中 <p:autocomplete>
不适用于 multiple=true
并且forceSelection=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;
}