Primefaces DataTable自动完成方面"过滤"

时间:2015-12-21 16:16:04

标签: jsf primefaces filter autocomplete

考虑以下Primefaces 5.3 JSF代码片段:

<p:column sortBy="#{benutzer.emailAdresse}" headerText="#{res.com_lbl_column_header_email}"
    filterBy="#{benutzer.emailAdresse}" filterStyle="margin-top:5px;" filterPosition="bottom" filterOptions="contains">

    <f:facet name="filter">
        <p:autoComplete id="dynaEmail" dropdown="true" inputStyleClass="inputFilterM" queryDelay="300"
            value="#{benutzerListBean.dyna_search_email}" completeMethod="#{benutzerListBean.completeTextEmail}"
            style="margin-left:10px;" cache="false" onchange="PF('tblBenutzer').filter()">
            <p:ajax event="keyup" update="dynaVorname, dynaNachname" listener="#{benutzerListBean.dynaSearchStringValueChanged}" />
            <p:ajax event="itemSelect" update="dynaVorname, dynaNachname"
                listener="#{benutzerListBean.dynaSearchStringValueChanged}" />
        </p:autoComplete>
        <p:commandButton icon="ui-icon-trash" style="margin-left:35px;">
            <f:param name="sender" value="dyna_search_email" />
            <p:ajax event="click" update="tblBenutzer, dynaEmail" listener="#{benutzerListBean.resetCurrentFilter}" />
        </p:commandButton>
    </f:facet>

    <h:outputText value="#{benutzer.emailAdresse}" />
</p:column>

所以在过滤器中自动完成。自动完成下拉菜单工作正常,但是当我输入内容时,我有一个奇怪的例外:

2015-12-21 19:08:30,739 INFO  [javax.enterprise.resource.webcontainer.jsf.context] (http-/0.0.0.0:8443-5) java.lang.ClassCastException: javax.faces.component.UIPanel cannot be cast to javax.faces.component.ValueHolder: java.lang.ClassCastException: javax.faces.component.UIPanel cannot be cast to javax.faces.component.ValueHolder
at org.primefaces.component.datatable.feature.FilterFeature.populateFilterMetaDataWithoutColumnGroups(FilterFeature.java:346) [primefaces-5.3.jar:5.3]
at org.primefaces.component.datatable.feature.FilterFeature.populateFilterMetaData(FilterFeature.java:259) [primefaces-5.3.jar:5.3]
at org.primefaces.component.datatable.feature.FilterFeature.decode(FilterFeature.java:90) [primefaces-5.3.jar:5.3]
at org.primefaces.component.datatable.DataTable.processValidators(DataTable.java:716) [primefaces-5.3.jar:5.3]
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:575) [jsf-impl-2.2.12.jar:2.2.12]
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183) [jsf-impl-2.2.12.jar:2.2.12]
at org.primefaces.component.api.UIData.visitTree(UIData.java:822) [primefaces-5.3.jar:5.3]

我已尝试将代码移至&#34;标题&#34; facet,它工作..但这种方式排序工作。

如何修复异常?

0 个答案:

没有答案