However, always got the following exception:
Code: Select all
com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback visit
Severe: java.lang.ArithmeticException: / by zero
The case can be simulated while user clicked the button "Refresh MyDataTable" to invoke a refresh:
My Code: font-end xhtml:
Code: Select all
<h:form id="myFrm1">
<p:commandButton title="Refresh MyDataTable"
image="ui-icon ui-icon-refresh" type="submit" ajax="true" process="this"
action="#{myBean.refreshMyDataTableData}"
update="myFrm2:pnlgDummy" />
</h:form>
<h:form id="myFrm2">
<h:panelGroup id="pnlgDummy">
<p:dataTable widgetVar="myDataTable" value="#{myBean.dataTableLazyData}"
var="record" paginator="true" rows="15" pageLinks="20" lazy="true" dynamic="true">
</p:dataTable>
</h:panelGroup>
</h:form>
Code: Select all
public void refreshMyDataTableData()
{
this.dataTableLazyData = new LazyDataModel<EntityObjectClass>()
{
private static final long serialVersionUID = 1L;
public List<Employee> load( int first, int pageSize, String sortField, boolean sortOrder, Map<String, String> filters )
{
this.setRowCount( getEntityObjectDbConnector().getAllRowCount() );
return getEntityObjectDbConnector().getAll( first, pageSize );
}
} ;
}
Are there anything I was wrong?
My library used:
PrimeFaces 2.2 RC2 + Sun Mojarra 2.0.3 FCS (b03) + Sun GlassFish JSTL 1.2.