I have a application using JSF2.0, Spring3 and Hibernate4.
I am displaying values in Primefaces 3.4.2 datatable, the problem is when I click the pagination, datatable rows always remain in first 10 records. It doesn't displays next 10 records.
My datatable code
<h:form>
<p:dataTable id="dataTable" var="req" value="#{reqMB.myList}"
paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15">
<f:facet name="header">
</f:facet>
<p:column>
<f:facet name="header">
<h:outputText value="XXX" />
</f:facet>
<h:outputText value="#{req.bbbb}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="XXXXS" />
</f:facet>
<h:outputText value="#{req.kkjj}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="XXXXXOO" />
</f:facet>
<h:outputText value="#{req.nnnn}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="XXXXKK" />
</f:facet>
<h:outputText value="#{req.kkkk}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="XKKKK" />
</f:facet>
<h:outputText value="#{req.pppp}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="LLLL" />
</f:facet>
<h:outputText value="#{req.llll}" />
</p:column>
</p:dataTable>
</h:form>
ManagedBean
@Named("reqMB")
@Scope("request")
public class MyBean implements Serializable {
private static final long serialVersionUID = 1L;
@Inject
MyService myService;
List<MyClass> myList;
public List<MyClass> getMyList() {
try {
myList= new ArrayList<MyClass>();
myList.addAll(getMyService().getMymethod());
} catch (Exception e) {
e.printStackTrace();
}
return myList;
}
How can I resolve this issue?
Update 1
I have noticed that when I display few number of records pagination works fine, but when I display records more than 1300, then pagination doesn't work.