0

I have a Primefaces dataTable like this in a <h:form> block:

<p:dataTable id="basicDT" var="partyDB" value="#{mbRechercheAbonne.listPartyDB}" 
                             paginator="true" 
                             emptyMessage="Aucun abonné ne correspond aux critères"
                             paginatorPosition="bottom" 
                             paginatorAlwaysVisible="false" 
                             rows="25" 
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="25,50,100"
                             currentPageReportTemplate="{startRecord} - {endRecord} sur {totalRecords} résultats"
                             filteredValue="#{mbRechercheAbonne.filteredListPartyDB}">

and a search button that populates the dataTable using a @ViewScoped bean that updates the value of listPartyDB when rechercheAbonne() is called:

<p:commandButton value="Rechercher" update="display :consultform:basicDT" icon="ui-icon-check"
                                     actionListener="#{mbRechercheAbonne.rechercheAbonne()}" onstart="startRecherche()" oncomplete="stopRecherche()"/>

Searching multiple times works, the dataTable's content changes like expected.

However, when using filtering and then removing the filter (i.e. adding a letter in a filter field above a column and then removing that letter), the search no longer works. I found that the search does actually work, but I need to apply a filter again (and remove it to have the unfiltered list) to see the result of the new search.

Explaining with pictures :

Searching for "test": Searching for "test"

Searching for "abc" right after, works as intended: Searching for "abc"

Searching for test again, filtering one column, works as intended: Filtering

Removing the filter (going back to pic 1), and then searching for "abc". Does not work: Removing the filter

Applying a filter again does it on the "abc" search that wasn't showing originally - removing the filter shows what the last search should have shown. Filtering again

Thanks for your help.

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Coloco
  • 353
  • 4
  • 14
  • Always, always, always create a [mcve] (for yourself) first and try in the latest version and if that fails, create a question and always, always, always state version info, and before that, search the PF issuelist if not using the latest version. – Kukeltje Mar 28 '18 at 09:20
  • The issue happens in the latest version and I didn't find it in the PF issuelist on Github. I'll do a MCVE but it's not like there is much code going on right now. – Coloco Mar 28 '18 at 09:45
  • Might be my issue, looking into it : https://github.com/primefaces/primefaces/issues/1753 – Coloco Mar 28 '18 at 09:50

0 Answers0