[richfaces-svn-commits] JBoss Rich Faces SVN: r1028 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Jun 5 13:55:47 EDT 2007


Author: abelevich
Date: 2007-06-05 13:55:47 -0400 (Tue, 05 Jun 2007)
New Revision: 1028

Modified:
   trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
Log:


Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java	2007-06-05 17:55:28 UTC (rev 1027)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java	2007-06-05 17:55:47 UTC (rev 1028)
@@ -32,7 +32,6 @@
 import org.richfaces.model.SortOrder;
 import org.richfaces.model.impl.ArrayDataModelExt;
 import org.richfaces.model.impl.ListDataModelExt;
-import org.richfaces.model.selection.Selection;
 
 
 
@@ -44,24 +43,23 @@
 
 public abstract class UIScrollableGrid extends UIRepeat implements AjaxComponent, Sortable{
 	
-	private Integer _requestedRows = new Integer(0) ;
 	
-	private Integer _dataIndex = new Integer(0);
-	
-	private Integer _startRow = new Integer(0);
-	
 	private transient Collection partialUpdateChildren;
-	
+		
 	private Collection responseData = new ArrayList();
+	
+	public abstract SortOrder getSortOrder();
 
+	public abstract void setSortOrder(SortOrder sortOrder) ;
+	
+	public abstract int getDefaultRows();
+	
+	public abstract void setDefaultRows(int defaultRows);
+	
 	public Collection getResponseData() {
 		return responseData;
 	}
 
-	public abstract SortOrder getSortOrder();
-
-	public abstract void setSortOrder(SortOrder sortOrder) ;
-
 	public void setResponseData(Collection responseData) {
 		this.responseData = responseData;
 	}
@@ -121,37 +119,11 @@
 		return model;		
 	}
 	
-	public Integer getDataIndex() {
-		return _dataIndex;
-	}
-
-	public void setDataIndex(Integer dataIndex) {
-		this._dataIndex = dataIndex;
-	}
-
-	public Integer getRequestedRows() {
-		return _requestedRows;
-	}
-
-	public void setRequestedRows(Integer row_count) {
-		this._requestedRows = row_count;
-	}
-
-	public Integer getStartRow() {
-		return _startRow;
-	}
-
-	public void setStartRow(Integer startRow) {
-		this._startRow = startRow;
-	}
-	
+		
 	public Object saveState(FacesContext context) {
 		
 		Object values[] = new Object[5];
 		values[0] = super.saveState(context);
-		values[1] = _requestedRows;
-		values[2] = _startRow;
-		values[3] = _dataIndex;
 		return (Object)values;
 	
 	}
@@ -160,9 +132,6 @@
 		
 		Object values[] = (Object[])state;
 		super.restoreState(context, values[0]);
-		_requestedRows = (Integer)values[1];
-		_startRow = (Integer)values[2];
-		_dataIndex = (Integer)values[3];
 	}
 
 	protected Iterator dataChildren() {
@@ -261,8 +230,15 @@
 		return partialUpdateChildren;
 	}
 	
+
+	
 	public void encodeEnd(FacesContext context) throws IOException {
 		super.encodeEnd(context);
 		partialUpdateChildren = null;
 	}
+	
+	public int getRows() {
+		int rows = super.getRows();
+		return rows != 0 ? rows : getDefaultRows(); 
+	}
 }




More information about the richfaces-svn-commits mailing list