Jsf Primefaces datatable排序在筛选表后有奇怪的行为

Jsf Primefaces datatable排序在筛选表后有奇怪的行为,jsf,primefaces,glassfish,jsf-2.2,Jsf,Primefaces,Glassfish,Jsf 2.2,我们在项目中使用primeface 5.1和JSF 2.2。 我在primefaces datatable中遇到了一个问题,在过滤datatable之后,排序将被破坏,如果尝试对该表进行排序,datatable中将不会显示任何记录。下面是jsf代码和问题快照 <p:dataTable id="myTable" var="model" value="#{myBean.dynaModels}" widgetVar="tableWidget" editable="true" styleClass

我们在项目中使用primeface 5.1和JSF 2.2。 我在primefaces datatable中遇到了一个问题,在过滤datatable之后,排序将被破坏,如果尝试对该表进行排序,datatable中将不会显示任何记录。下面是jsf代码和问题快照

<p:dataTable id="myTable" var="model" value="#{myBean.dynaModels}" widgetVar="tableWidget" editable="true" styleClass="ui-dyna-table" 
         rows="10" paginator="true" resizableColumns="true" tableStyle="width:auto" filterEvent="enter" emptyMessage="No service order found"
         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {CurrentPageReport}" draggableColumns="true"
         currentPageReportTemplate="{startRecord} - {endRecord} of {totalRecords}" paginatorPosition="top" rowsPerPageTemplate="10,20,50,100" style="margin-right: 5px"> 
<f:facet name="header">
    <p:commandButton id="toggler" type="button" value="Columns" style="float:right" icon="ui-icon-calculator" />
    <p:columnToggler datasource="myTable" trigger="toggler" />
</f:facet>
<c:forEach items="#{myBean.columnProperties}" var="columnProperty" >
    <p:column headerText="#{columnProperty.descr}" rendered="#{columnProperty.componentType.value eq 'S1'}" filterBy="#{model.dyanModelMap[columnProperty.propertyKey].value}" 
              sortBy="#{model.dyanModelMap[columnProperty.propertyKey].value}" filterMatchMode="exact">
        <f:facet name="filter" >
            <p:selectOneMenu style="width:111px" onchange="PF('tableWidget').filter()" >
                <f:selectItem itemValue="" noSelectionOption="true"/>
                <f:selectItems value="#{columnProperty.lov}" />
            </p:selectOneMenu>
        </f:facet>
        <h:outputText value="#{model.dyanModelMap[columnProperty.propertyKey].value}"  />
    </p:column>
    <p:column headerText="#{columnProperty.descr}" rendered="#{columnProperty.componentType.value eq 'TXT'}" filterBy="#{model.dyanModelMap[columnProperty.propertyKey].value}" 
              sortBy="#{model.dyanModelMap[columnProperty.propertyKey].value}" filterMatchMode="contains">  
        <h:outputText value="#{model.dyanModelMap[columnProperty.propertyKey].value}"  />
    </p:column>
    <p:column headerText="#{columnProperty.descr}" rendered="#{columnProperty.componentType.value eq 'DT'}" filterBy="#{model.dyanModelMap[columnProperty.propertyKey].value}" sortBy="#{model.dyanModelMap[columnProperty.propertyKey].value}">
        <f:facet name="filter" >
            <p:calendar  showOn="button" onchange="PF('tableWidget').filter()" >
            </p:calendar>
        </f:facet>
        <h:outputText value="#{model.dyanModelMap[columnProperty.propertyKey].value}"  />
    </p:column>
</c:forEach>


在datatable中添加并实现filteredValue属性。这为我解决了问题。

您以前/现在使用的是纯5.1?不是精英释放?Iirc,它是在精英版本中修复的。如果可能的话,请为我添加一些示例代码。谢谢一个人怎么会知道这件事呢……)即使这样做了,并且阅读了(非常有限的)关于它的文档,我也无法理解它为什么会这样做。