myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r209323 - /myfaces/api/trunk/src/java/javax/faces/component/UIData.java
Date Tue, 05 Jul 2005 20:59:09 GMT
Author: schof
Date: Tue Jul  5 13:59:07 2005
New Revision: 209323

URL: http://svn.apache.org/viewcvs?rev=209323&view=rev
Log:
revised patch from Mathia Broekelmann (for MYFACES-228)

Modified:
    myfaces/api/trunk/src/java/javax/faces/component/UIData.java

Modified: myfaces/api/trunk/src/java/javax/faces/component/UIData.java
URL: http://svn.apache.org/viewcvs/myfaces/api/trunk/src/java/javax/faces/component/UIData.java?rev=209323&r1=209322&r2=209323&view=diff
==============================================================================
--- myfaces/api/trunk/src/java/javax/faces/component/UIData.java (original)
+++ myfaces/api/trunk/src/java/javax/faces/component/UIData.java Tue Jul  5 13:59:07 2005
@@ -125,7 +125,7 @@
 
 		FacesContext facesContext = getFacesContext();
 
-		saveDescendantComponentStates(facesContext, this);
+		saveDescendantComponentStates(facesContext, getFacetsAndChildren());
 
 		_rowIndex = rowIndex;
 
@@ -156,30 +156,30 @@
 			}
 		}
 
-		restoreDescendantComponentStates(facesContext, this);
+		restoreDescendantComponentStates(facesContext, getFacetsAndChildren());
 	}
 
-	private void saveDescendantComponentStates(FacesContext context, UIComponent component)
+	private void saveDescendantComponentStates(FacesContext context, Iterator childIterator)
 	{
-		for (Iterator i = component.getFacetsAndChildren(); i.hasNext();)
+		while (childIterator.hasNext())
 		{
-			UIComponent child = (UIComponent) i.next();
-			if (child.isRendered())
+			UIComponent child = (UIComponent) childIterator.next();
+			if (!child.isTransient())
 			{
 				_rowState.put(child.getClientId(context), new ChildStateHolder(context, child));
-				saveDescendantComponentStates(context, child);
+				saveDescendantComponentStates(context, child.getFacetsAndChildren());
 			}
 		}
 	}
 
-	private void restoreDescendantComponentStates(FacesContext context, UIComponent component)
+	private void restoreDescendantComponentStates(FacesContext context, Iterator childIterator)
 	{
-		for (Iterator i = component.getFacetsAndChildren(); i.hasNext();)
+		while (childIterator.hasNext())
 		{
-			UIComponent child = (UIComponent) i.next();
+			UIComponent child = (UIComponent) childIterator.next();
 			//reset clientId to null
 			child.setId(child.getId());
-			if (child.isRendered())
+			if (!child.isTransient())
 			{
 				String clientId = child.getClientId(context);
 				ChildStateHolder childStateHolder = (ChildStateHolder) _rowState.get(clientId);
@@ -187,7 +187,7 @@
 				{
 					childStateHolder.restoreState(context, child);
 				}
-				restoreDescendantComponentStates(context, child);
+				restoreDescendantComponentStates(context, child.getFacetsAndChildren());
 			}
 		}
 	}
@@ -676,10 +676,10 @@
 		values[ROWS_INDEX] = _rows;
 		values[VALUE_INDEX] = _value;
 		values[VAR_INDEX] = _var;
-		if (!_isValidChilds)
-		{
-			values[ROW_STATE_INDEX] = _rowState;
-		}
+//		if (!_isValidChilds)
+//		{
+//			values[ROW_STATE_INDEX] = _rowState;
+//		}
 		return ((Object) (values));
 	}
 
@@ -691,11 +691,11 @@
 		_rows = (Integer) values[ROWS_INDEX];
 		_value = (Object) values[VALUE_INDEX];
 		_var = (String) values[VAR_INDEX];
-		Map rowState = (Map) values[ROW_STATE_INDEX];
-		if (rowState != null)
-		{
-			_rowState = rowState;
-		}
+//		Map rowState = (Map) values[ROW_STATE_INDEX];
+//		if (rowState != null)
+//		{
+//			_rowState = rowState;
+//		}
 	}
 
 	//------------------ GENERATED CODE BEGIN (do not modify!) --------------------



Mime
View raw message