Reputation: 21
I'm currently working on lookups Table for a JSF Project. I have this table which will display a lot of codes later when linked to the database (for now it's hardcoded data) so I added primefaces 5.0 pagination. The problem here is that I have a Bug which happens when I created a Table for a specific code, change code , then go back to this table. Look what happens :
An infinite number of pages with only 3 data... Every page are the same, and if I change the number of result per page, the problem disappear.
Here is the table in the code :
<h:form id="currentTable">
<p:growl id="msgs" showDetail="true"/>
<p:dataTable widgetVar="dataTableWidgetVar" var="lookupRow"
value="#{lookupsView.currentLookup.lookupRows}" editable="true"
style="margin-bottom:20px"
styleClass="tableWrapText"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="10, 20, 30, 40, 50, 100, 200"
filteredValue="#{lookupsView.filteredLookupRows}">
<p:ajax event="rowEdit" update=":currentTable:msgs" listener="#{lookupsView.onRowEdit}"/>
<p:ajax event="rowEditCancel" update=":currentTable:msgs"
listener="#{lookupsView.onRowCancel}"/>
<p:column headerText="XBRL Code" filterBy="#{lookupRow.xbrlCodeMember.memberValue}"
footerText="contains" filterMatchMode="contains">
<h:outputText value="#{lookupRow.xbrlCodeMember.memberValue}"/>
</p:column>
<p:column headerText="Client Code " filterBy="#{lookupRow.clientCode}" footerText="contains"
filterMatchMode="contains">
<p:cellEditor>
<f:facet name="output"> <h:outputText value="#{lookupRow.clientCode}"/></f:facet>
<f:facet name="input"><p:inputText value="#{lookupRow.clientCode}" style="width:100%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="XBRL Label" filterBy="#{lookupRow.xbrlCodeMember.memberDescription}"
footerText="contains" filterMatchMode="contains">
<h:outputText value="#{lookupRow.xbrlCodeMember.memberDescription}"/>
</p:column>
<p:column headerText="Client Label" filterBy="#{lookupRow.clientDescription}"
footerText="contains" filterMatchMode="contains">
<p:cellEditor>
<f:facet name="output"><h:outputText value="#{lookupRow.clientDescription}"/></f:facet>
<f:facet name="input"><p:inputText value="#{lookupRow.clientDescription}"
style="width:100%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:32px">
<p:rowEditor/>
</p:column>
</p:dataTable>
</h:form>
Do you know where this bug could come from ? It's on a Jboss7 server.
Upvotes: 1
Views: 423
Reputation: 21
I found the solution, it happened because of the "#{lookupsView.filteredLookupRows}" variable, you have to clean by setting it to null, every time you change which table you display or it breaks somehow.
Upvotes: 1