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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri May 11 11:32:13 EDT 2007


Author: abelevich
Date: 2007-05-11 11:32:13 -0400 (Fri, 11 May 2007)
New Revision: 736

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-05-11 15:32:03 UTC (rev 735)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java	2007-05-11 15:32:13 UTC (rev 736)
@@ -3,14 +3,20 @@
  */
 package org.richfaces.component;
 
+import java.io.IOException;
 import java.util.Iterator;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
 import javax.faces.event.FacesEvent;
 import javax.faces.event.PhaseId;
+import javax.faces.model.DataModel;
 
+import org.ajax4jsf.ajax.repeat.DataVisitor;
+import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
 import org.ajax4jsf.ajax.repeat.UIRepeat;
+import org.ajax4jsf.framework.ajax.AjaxContext;
 import org.ajax4jsf.framework.ajax.AjaxEvent;
 import org.apache.commons.collections.iterators.IteratorChain;
 
@@ -22,10 +28,67 @@
 
 public class UIScrollableGrid extends UIRepeat{
 	
-	public UIScrollableGrid() {
-		super();
+	private Integer _row_count = new Integer(0) ;
+	
+	private Integer _dataIndex = new Integer(0);
+	
+	private Integer _startRow = new Integer(0);
+	
+	
+	public Integer getDataIndex() {
+		return _dataIndex;
 	}
+
+
+
+	public void setDataIndex(Integer dataIndex) {
+		this._dataIndex = dataIndex;
+	}
+
+
+
+	public Integer getRow_count() {
+		return _row_count;
+	}
+
+
+
+	public void setRow_count(Integer row_count) {
+		this._row_count = row_count;
+	}
+
+
+
+	public Integer getStartRow() {
+		return _startRow;
+	}
+
+
+
+	public void setStartRow(Integer startRow) {
+		this._startRow = startRow;
+	}
 	
+	public Object saveState(FacesContext context) {
+		Object values[] = new Object[4];
+		values[0] = super.saveState(context);
+		values[1] = _row_count;
+		values[2] = _startRow;
+		values[3] = _dataIndex;
+		
+		return (Object)values;
+	
+	}
+	
+	public void restoreState(FacesContext context, Object state) {
+		Object values[] = (Object[])state;
+		super.restoreState(context, values[0]);
+		_row_count = (Integer)values[1];
+		_startRow = (Integer)values[2];
+		_dataIndex = (Integer)values[3];
+		
+	}
+
 	protected Iterator dataChildren() {
 		
 		IteratorChain chain = new IteratorChain();
@@ -55,10 +118,22 @@
 		return chain;
 	}
 	
+	public void broadcast(FacesEvent event) throws AbortProcessingException {
+		super.broadcast(event);
+		if(event instanceof AjaxEvent){
+			AjaxContext.getCurrentInstance().addComponentToAjaxRender(this);
+		}
+	}
+	
 	public void queueEvent(FacesEvent event) {
 		if(event instanceof AjaxEvent){
 			event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
 		}
 		super.queueEvent(event);
 	}
+	
+	public void walk(FacesContext faces, DataVisitor visitor, Object argument) throws IOException {
+	
+		super.walk(faces, visitor, argument);
+	}
 }




More information about the richfaces-svn-commits mailing list