2013-12-06 7 views
1

Я использую сложный тип данных, который может сортировать и фильтровать с помощью фильтра. моя проблема заключается в том, что я пытаюсь использовать фильтр столбцов, глобальный фильтр или сортировку. datatable pagination внезапно падает до 1 страницы и не возвращается к первому состоянию с разбивкой на страницы. В начале у меня 92 страницы, но после фильтрации/сортировки он становится datatable с 1 страницей, хотя я очищаю текстовое поле фильтра, оно остается как 1 страница.Primefaces Complex Datatable Filtering and Sorting

Вот моя DataTable:

<h:panelGroup rendered="#{projectsController.items.rowCount > 0}"> 
<p:growl id="growl" /> 
<p:dataTable id="datatable" value="#{projectsController.items}" var="item" filterEvent="keyup" 
      paginator="true" rows="5" emptyMessage="Proje bulunamadı." paginatorPosition="bottom" 
      paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
      rowsPerPageTemplate="4,5,6,7,8,9,10" 
      filteredValue="#{projectsController.filteredProjects}" style="font-size:11px;font-weight: bold;" widgetVar="proj" > 

    <f:facet name="header"> 
     <p:outputPanel> 
      <h:outputText value="Tüm Alanlarda Ara: " /> 
      <p:inputText id="globalFilter" onkeyup="proj.filter();" style="width:150px" /> 
     </p:outputPanel> 
    </f:facet> 


    <p:column id="c1" headerText="Proje Adı" width="500" filterStyle="display:none" styleClass="wrap" sortBy="#{item.projectname}" filterBy="#{item.projectname}" filterMatchMode="contains" > 
     <h:outputText value="#{item.projectname}"/> 
    </p:column> 

    <p:column headerText="İlçe" width="150" styleClass="wrap" filterStyle="display:none" filterBy="#{item.district}" sortBy="#{item.district}" filterOptions="#{populator.districtsDD}" filterMatchMode="exact"> 
     <h:outputText value="#{item.district}"/> 
    </p:column> 

    <p:column headerText="Sektör" width="150" styleClass="wrap" filterStyle="display:none" filterBy="#{item.sector}" sortBy="#{item.sector}" filterOptions="#{populator.sectorsDD}" filterMatchMode="exact"> 
     <h:outputText value="#{item.sector}"/> 
    </p:column> 

    <p:column headerText="Başlangıç Tarihi" width="150" styleClass="wrap" filterStyle="display:none" sortBy="#{item.startdate}" filterBy="#{item.startdate}" filterMatchMode="contains"> 
     <h:outputText value="#{item.startdate}"/> 
    </p:column> 

    <p:column headerText="Bitiş Tarihi" width="150" styleClass="wrap" filterStyle="display:none" sortBy="#{item.enddate}" filterBy="#{item.enddate}" filterMatchMode="contains"> 
     <h:outputText value="#{item.enddate}"/> 
    </p:column> 

    <p:column headerText="İş Durumu" width="150" styleClass="wrap" filterStyle="display:none" sortBy="#{item.workstatus}" filterBy="#{item.workstatus}" filterMatchMode="contains"> 
     <h:outputText value="#{item.workstatus}"/> 
    </p:column> 

    <p:column> 
     <p:commandButton id="selectButton" update=":display" oncomplete="carDialog.show()" icon="ui-icon-search" title="Detayları Gör"> 
      <f:setPropertyActionListener value="#{item}" target="#{projectsController.selectedP}" /> 
      <p:ajax event="click" update=":viewTabs:tabView:mapTab"/> 
     </p:commandButton> 
     <p:commandButton id="editButton" update=":displayEdit" oncomplete="editDialog.show()" icon="ui-icon-pencil" title="Düzenle"> 
      <f:setPropertyActionListener value="#{item}" target="#{projectsController.selectedP}" /> 
     </p:commandButton> 
     <p:commandButton update="growl" title="Projeyi Sil" id="confirm" action="#{projectsController.destroy}" icon="ui-icon-trash" ajax="false" onclick="if (!confirm('Bu projeyi gerçekten silmek istiyor musunuz?')) 
              return false;"/> 
     </p:column> 
</p:dataTable> 

После фильтрации или сортировки, как я могу вернуть мой DataTable в первое состояние? Заранее спасибо.

Primefaces 3,5, Oracle WebLogic 10g, JSF 2,2

Вот снимок:

enter image description here

ответ

1

Для тех, кто хочет знать решение, я снял как JSF-api.jar и jsf-impl.jar из библиотек, вместо этого я поставил собственную библиотеку jsf2.1 netbeans. В основном я понизился до jsf2.1. Я просто подозреваю, что jsf-api и jsf-impl дают мне поддержку jsf2.2.

Надеюсь, это поможет кому-то.