myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svieu...@apache.org
Subject cvs commit: incubator-myfaces/src/components/org/apache/myfaces/custom/datascroller HtmlDataScrollerRenderer.java
Date Tue, 04 Jan 2005 01:42:23 GMT
svieujot    2005/01/03 17:42:23

  Modified:    src/components/org/apache/myfaces/custom/datascroller
                        HtmlDataScrollerRenderer.java
  Log:
  Bugfix for last page.
  
  Revision  Changes    Path
  1.19      +11 -2     incubator-myfaces/src/components/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java
  
  Index: HtmlDataScrollerRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/datascroller/HtmlDataScrollerRenderer.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- HtmlDataScrollerRenderer.java	4 Jan 2005 00:28:07 -0000	1.18
  +++ HtmlDataScrollerRenderer.java	4 Jan 2005 01:42:23 -0000	1.19
  @@ -37,6 +37,9 @@
    * @author Thomas Spiegl (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.19  2005/01/04 01:42:23  svieujot
  + * Bugfix for last page.
  + *
    * Revision 1.18  2005/01/04 00:28:07  svieujot
    * dataScroller, add rowsCountVar, displayedRowsCountVar, firstRowIndexVar and lastRowIndexVar
attributes.
    *
  @@ -196,6 +199,9 @@
           if (displayedRowsCountVar != null)
           {
               int displayedRowsCount = uiData.getRows();
  +            int max = uiData.getRowCount()-uiData.getFirst();
  +            if( displayedRowsCount > max )
  +                displayedRowsCount = max;
               requestMap.put(displayedRowsCountVar, new Integer(displayedRowsCount));
           }
           String firstRowIndexVar = scroller.getFirstRowIndexVar();
  @@ -208,6 +214,9 @@
           if (lastRowIndexVar != null)
           {
               int lastRowIndex = uiData.getFirst()+uiData.getRows();
  +            int count = uiData.getRowCount();
  +            if( lastRowIndex > count )
  +                lastRowIndex = count;
               requestMap.put(lastRowIndexVar, new Integer(lastRowIndex));
           }
   
  
  
  

Mime
View raw message