I want to use Primefaces datascroller with lazy loading.I have a problem about lazy loading.I noticed that Datascroller called load method twice.However,When I change p:datascroller with p:datatable,Lazy Loading works very well.Please help me,what is the my problem about datascroller lazy load.
<p:dataScroller
id="messagesDataScroller"
value="#{messagesGridDialogBean.items}"
lazy="true"
var="item"
widgetVar="messagesDataScroller"
mode="inline"
chunkSize="#{messagesGridDialogBean.items.rowCount}"
rowIndexVar="rowIndex"
scrollHeight="400" >
<f:facet name="header">
Mesajlar
</f:facet>
<h:panelGrid columns="2" style="width:400px" >
<h:outputText value="#{strings.messages_send_date}" style="font-weight: bold" />
<h:outputText value="#{item.messageSendDate}" >
<f:converter converterId="GregorianCalendarConverter" />
<f:attribute name="pattern" value="dd/MM/yyyy HH:mm" />
</h:outputText>
<h:outputText value="#{strings.messages_subject} " style="font-weight: bold" />
<h:outputText value="#{item.jobWarning.warningText}" />
<h:outputText value="#{strings.global_description} " style="font-weight: bold" />
<h:outputText value="#{item.description}" escape="false" />
<p:spacer height="3" />
<p:spacer height="3" />
</h:panelGrid>
<p:commandButton title="#{strings.messages_readMessage}" icon="ui-icon-check" actionListener="#{messagesFormBean.checkMessageRead(item.tblId,2)}" update="messagesDataScroller" />
<p:commandButton title="#{strings.messages_sendArchieve}" icon="ui-icon-folder-collapsed" actionListener="#{messagesFormBean.checkMessageRead(item.tblId,3)}" update="messagesDataScroller" />
</p:dataScroller>
And also load method in java code
public List<JobWarningUsers> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String,Object> filters) {
this.setRowCount((int) service.messageCount());// TODO make safe cast
List<JobWarningUsers> lst=new ArrayList<JobWarningUsers>();
lst=service.load(first, pageSize, sortField, tr.gov.diski.tender.common.GenericDao.SortOrder.valueOf(SortOrder.DESCENDING.name()), filters);
return lst;
}