Code: Select all
java.lang.ArithmeticException: / by zero
at org.primefaces.model.LazyDataModel.setRowIndex(LazyDataModel.java:62)
at javax.faces.component.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:485)
at javax.faces.component.UIData.setRowIndex(UIData.java:473)
at javax.faces.component.UIData.visitRows(UIData.java:2123)
at javax.faces.component.UIData.visitTree(UIData.java:1437)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIForm.visitTree(UIForm.java:344)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at com.sun.faces.application.view.StateManagementStrategyImpl.saveView(StateManagementStrategyImpl.java:149)
at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:133)
at javax.faces.application.StateManager.getViewState(StateManager.java:553)
at com.sun.faces.context.PartialViewContextImpl.renderState(PartialViewContextImpl.java:409)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:293)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
Code: Select all
<p:dataTable value="#{lazyloadBean.lazyList}" var="person" lazy="true" rows="28" liveScroll="true" scrollRows="15" scrollHeight="110" scrollable="true" >
Code: Select all
@ManagedBean(name="lazyloadBean")
@RequestScoped
public class LazyloadBean {
private LazyDataModel<QuickProfileIntro> lazyList;
public LazyloadBean() {
lazyList = new LazyDataModel<QuickProfileIntro>() {
@Override
public List<QuickProfileIntro> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, String> filters) {
List<QuickProfileIntro> list = new ArrayList<QuickProfileIntro>(pageSize);
// filling this list from DB...
return list;
}
};
lazyList.setRowCount(100000);
}
public LazyDataModel<QuickProfileIntro> getLazyList() {
Easy.log("getLazyList called");
return lazyList;
}
}