在 primefaces 上使用带有 elasticSearch 的 selectManyButton
use selectManyButton with elasticSearch on primefaces
我正在尝试使用组件 selectManyButton
来更新数据列表,但它不起作用。当我使用 selectOneButton
时,它工作正常。
我用来过滤的方法是 ElasticSearch 查询。
这段代码没有错误:
<p:selectOneButton value="#{carEsBean.carEs.carburant}">
<f:selectItem itemLabel="Diesel" itemValue="Diesel" />
<f:selectItem itemLabel="Essence" itemValue="Essence" />
<f:selectItem itemLabel="Hybride" itemValue="Hybride" />
<p:ajax event="change" update="selectedCarsList" />
</p:selectOneButton>
<p:dataList value="#{carEsBean.carsQuery}" var="car" type="definition"
id="selectedCarsList" paginator="true" rows="10" >
当我想使用它时,它不起作用:
<p:selectManyButton value="#{carEsBean.carEs.carburant}">
<f:selectItem itemLabel="Diesel" itemValue="Diesel" />
<f:selectItem itemLabel="Essence" itemValue="Essence" />
<f:selectItem itemLabel="Hybride" itemValue="Hybride" />
<p:ajax event="change" update="selectedCarsList" />
</p:selectManyButton>
我正在使用的查询是:
if (StringUtils.isNotBlank(carEs.getCarburant())) {
if (query == null) {
query = QueryBuilders.boolQuery().must(QueryBuilders.matchQuery("carburant", carEs.getCarburant()));
} else {
query = query.must(QueryBuilders.matchQuery("carburant", carEs.getCarburant()));
}
}
我在 Springboot 上使用 primefaces 6.2、jsf 2.3
carEsBean.carEs.carburant
这部分应该是字符串列表 List<String>
,而不是 String
才能使用 SelectManyButton
查看展示柜了解更多信息
https://www.primefaces.org/showcase/ui/input/manyButton.xhtml
我正在尝试使用组件 selectManyButton
来更新数据列表,但它不起作用。当我使用 selectOneButton
时,它工作正常。
我用来过滤的方法是 ElasticSearch 查询。
这段代码没有错误:
<p:selectOneButton value="#{carEsBean.carEs.carburant}">
<f:selectItem itemLabel="Diesel" itemValue="Diesel" />
<f:selectItem itemLabel="Essence" itemValue="Essence" />
<f:selectItem itemLabel="Hybride" itemValue="Hybride" />
<p:ajax event="change" update="selectedCarsList" />
</p:selectOneButton>
<p:dataList value="#{carEsBean.carsQuery}" var="car" type="definition"
id="selectedCarsList" paginator="true" rows="10" >
当我想使用它时,它不起作用:
<p:selectManyButton value="#{carEsBean.carEs.carburant}">
<f:selectItem itemLabel="Diesel" itemValue="Diesel" />
<f:selectItem itemLabel="Essence" itemValue="Essence" />
<f:selectItem itemLabel="Hybride" itemValue="Hybride" />
<p:ajax event="change" update="selectedCarsList" />
</p:selectManyButton>
我正在使用的查询是:
if (StringUtils.isNotBlank(carEs.getCarburant())) {
if (query == null) {
query = QueryBuilders.boolQuery().must(QueryBuilders.matchQuery("carburant", carEs.getCarburant()));
} else {
query = query.must(QueryBuilders.matchQuery("carburant", carEs.getCarburant()));
}
}
我在 Springboot 上使用 primefaces 6.2、jsf 2.3
carEsBean.carEs.carburant
这部分应该是字符串列表 List<String>
,而不是 String
才能使用 SelectManyButton
查看展示柜了解更多信息 https://www.primefaces.org/showcase/ui/input/manyButton.xhtml