You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/01/14 12:32:24 UTC
svn commit: r369007 -
/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
Author: weber
Date: Sat Jan 14 03:32:11 2006
New Revision: 369007
URL: http://svn.apache.org/viewcvs?rev=369007&view=rev
Log:
fix row calculation
Modified:
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java?rev=369007&r1=369006&r2=369007&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java Sat Jan 14 03:32:11 2006
@@ -279,10 +279,14 @@
public int getPage() {
int first = getFirst() + 1;
int rows = getRows();
- if ((first % rows) == 1) {
- return (first / rows) + 1;
+ if (rows == 1) {
+ return first;
} else {
- return (first / rows) + 2;
+ if ((first % rows) == 1) {
+ return (first / rows) + 1;
+ } else {
+ return (first / rows) + 2;
+ }
}
}