PrimeFaces dataTable filterBy在javax.faces.SEPARATOR_CHAR更改时不



从PrimeFaces 8更新到10后,dataTable中的filterBy不再工作。我创建了一个小的测试项目,发现如果我删除了设置为-的参数javax.faces.SEPARATOR_CHAR,过滤就会再次正常工作。

我不明白为什么这个参数会影响表筛选。

是否有其他原因导致问题?否则,我将不得不在使用分隔符的项目中更改ID的所有使用。

这是我的示例项目

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</h:head>
<h:body>
<h:form>
<p:dataTable var="item"
sortBy="#{item}"
value="#{testBean.items}">
<p:column headerText="Item" filterBy="#{item}" filterMatchMode="contains">
<p:outputLabel value="#{item}"/>
</p:column>
</p:dataTable>
</h:form>
</h:body>
</html>
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
import org.apache.commons.lang3.StringUtils;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Named
@ViewScoped
public class TestBean implements Serializable {
private String item;
private final List<String> items = Arrays
.asList("item0", "item1", "item2", "item3", "item4", "item5", "item6", "item/", "item8", "item9");
}

正如@tandraschko和@Melloware所解释的,这是PF 10.0.0中的错误,在v11.0.0中得到了修复。

最新更新