I got dataTable defined as:
<p:dataTable var="account" value="#{customerBean.accounts}"
id="accounts" lazy="true">
<p:column>
<f:facet name="header">
<h:outputText value="#{msg['editCustomerForm.accountNumbers.header']}" />
</f:facet>
<h:outputText value="#{account.accountNumber}" />
</p:column>
</p:dataTable>
And accounts are loaded in this method (called in @PostConstruct method)
private void initAccounts() {
accounts = new CustomLazyDataModel<Account>() {
@Override
public List<Account> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, String> filters) {
return accountService.getAccountsForCustomer(customerModel.getCustomer(), first, pageSize);
}
};
accounts.setPageSize(10);
}
CustomLazyDataModel is there only because of this bug: http://code.google.com/p/primefaces/issues/detail?id=1544 (see comment #23)
But when page is rendered, component says "No records found."
SQL in hibernate log executed on the server returns 1 row and when i use dataList insted of dataTable result is corect (1 row is rendered).
<p:dataList value="#{customerBean.accounts}" var="account"
id="accounts-old" rows="10"
type="none" lazy="true">
<f:facet name="header">
<h:outputText value="#{msg['editCustomerForm.accountNumbers.header']}" />
</f:facet>
<h:outputText value="#{account.accountNumber}" />
</p:dataList>
When using <h:dataTable>
records are there also. So what is the problem with <p:dataTable>
?