我正在过滤我的dataTable,并希望使用自定义函数过滤它。问题是,我想将datatable的两列作为输入。实现filterFunction的默认签名是public boolean filter(Object value, Object filter, Locale locale),在value参数中,它保存由"filterBy"属性传递的任何内容。让它变得更棘手的是--我使用的字段不是关键--它可以具有相同的值。是否可以将多个值传递给"filterBy",或者在backing函数中以某种方式获得整个dataTable行?
发布于 2015-05-13 13:00:24
我找到了一种解决该问题的方法:传递给"filterBy"属性的任何内容都是用EL(表达式语言)编写的,所以我可以这样编写过滤器:
在xhtml:... filterBy="#{item.property1};#{item.property2}" ...
在过滤功能方面:
public boolean filter(Object value, Object filter, Locale locale){
...
String[] properties = value.toString().split(";");
...https://stackoverflow.com/questions/30215204
复制相似问题