Primefaces pickList的自定义过滤器

3
我将尝试为Primefaces的下拉菜单创建自定义过滤器。但是,在按照手册说明操作时,我在Primefaces中遇到了TypeError类型错误。
以下是我的下拉菜单定义:
  <p:pickList id="theId"
    value="#{...}" var="variable"
    itemLabel="#{variable.something} #{variable.somethingelse}" itemValue="#{variable}"
    converter="#{genericConverter}"
    showSourceFilter="true" showTargetFilter="true"
    filterMatchMode="custom" filterFunction="myFunction"></p:pickList>

我的过滤函数
 <script type="text/javascript">
                    function myFunction(itemLabel, filterValue){
                            return  itemLabel.indexOf(filterValue) != -1;
                    }
        </script>

当我在搜索框中输入内容时,控制台会出现以下错误。
Uncaught TypeError: Property 'filterMatcher' of object #<d> is not a function 

看起来,属性filterFunction作为字符串传递给了primefaces javascript代码,因此无法用作函数。

任何帮助都将是极好的,
谢谢 Wim

1个回答

2

你的回答中是否可以包含解决方法? - Mark

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接