0

Primefacesのexact-filter関数を使用しているデータテーブルに列があります。

foo1にデータテーブルのデフォルト フィルタを設定する必要がありますが、 all に設定しています。

<p:column filterMatchMode="exact"
                    filterOptions="#{bean.filterFooOptions}"
                    filterBy="#{row.foo}">
                    <f:facet name="header">
                        <h:outputText value="Foo" />
                    </f:facet>
                    <h:outputText value="#{row.foos}" />
                </p:column>

そして、私のBeanでフィルターオプションを取得する方法:

  public SelectItem[] getFilterFooOptions() {
        if (items == null) {
            items =
                    new SelectItem[] { new SelectItem(Foo.foo1.name()),
                            new SelectItem(Foo.foo2.name()), new SelectItem("", "all")};
        }
        return items;

    }
4

0 に答える 0