p:dataTable Error in 3.0M4 SNAPSHOT for paginator=true

UI Components for JSF
Post Reply
User avatar
bercolax
Posts: 133
Joined: 02 Aug 2009, 13:27
Location: Courtallam, India
Contact:

27 Oct 2011, 08:01

Scenario:
- Specify a p:dataTable inside p:tab within a p:tabView as shown in code below.
- Specify paginator=true but do not specify and value for rows attribute.
<p:tab title="Attachments">
<p:fileUpload fileUploadListener="#{articleAction.handleFileUpload}"
mode="advanced"

sizeLimit="1000000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/" update="exhibittbl"/>


<p:outputPanel id="exhibittbl">
<p:dataTable value="#{articleAction.article.articleExhibitList}" var="ae" paginator="true">
<p:column>

<h:outputText value="http://cdn.skillrack.com/#{ae.exhibit.fileurl}"/>

</p:column>

</p:dataTable>
</p:outputPanel>


</p:tab>

</p:tabView>
Error is
java.lang.ArithmeticException: / by zero
at org.primefaces.component.api.UIData.calculatePage(UIData.java:111)
at org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:188)
at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:98)
However if you specify a value for rows attribute the error does not occur. PrimeFaces should consider a default value for rows rather than leaving it as zero.
PrimeFaces 3.4, Seam Faces 3.0.2.Final, Glassfish v3.1, Mojarra 2.1.10, NetBeans 7.2, Hibernate JPA 2.0, Seam Persistence 3.0.0.Final Theme default HOT-SNEAKS

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Oct 2011, 09:39

Fixed in trunk, thanks for the heads up!

User avatar
bercolax
Posts: 133
Joined: 02 Aug 2009, 13:27
Location: Courtallam, India
Contact:

27 Oct 2011, 18:42

Not sure if the code change causes the following in today's snapshot build.

I set rows=1 and paginator=true for a dataTable as below(I am displaying questions in an exam and want to display one question at a time).

Code: Select all

            <p:dataTable  id="qlist_tbl" widgetVar="qlisttbl"  paginator="true" rows="1"  
                     value="#{freeExamDeliveryAction.examToDeliver.questionCollection}" var="q">
The dataTable displays only 1-10 page links. When i click forward or fastforward buttons the questions change but the page link numbers dont change.
That is even if 25th question is displayed the page links numbers show from 1-10. (One would expect the page link 25 appearing in the visible page links)

Also in JavaScript if I invoke

Code: Select all

qlisttbl.getPaginator().setPage(#{freeExamDeliveryAction.pageToShow});   
, and value of pageToShow is 5, the page shown in dataTable is 6 (that is +1).

All the above things were working fine till yesterday.
PrimeFaces 3.4, Seam Faces 3.0.2.Final, Glassfish v3.1, Mojarra 2.1.10, NetBeans 7.2, Hibernate JPA 2.0, Seam Persistence 3.0.0.Final Theme default HOT-SNEAKS

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Oct 2011, 20:59

Levent, please step in to replicate with latest code.

User avatar
leventgny
Posts: 238
Joined: 24 May 2011, 16:49
Contact:

28 Oct 2011, 00:05

Revision already checked in. And on latest labs data pagination starts from zero index.

Thanks,
PrimeFaces Team Member

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests