myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r933753 - in /myfaces/core/trunk/api/src: main/java/javax/faces/component/UIData.java test/java/javax/faces/component/UIDataTest.java
Date Tue, 13 Apr 2010 19:19:14 GMT
Author: jakobk
Date: Tue Apr 13 19:19:14 2010
New Revision: 933753

URL: http://svn.apache.org/viewvc?rev=933753&view=rev
Log:
MYFACES-2137 JSF 2.0 Component Tree Visiting (fix UIData.visitTree() according to Mojarra
issue #1483)

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/UIData.java
    myfaces/core/trunk/api/src/test/java/javax/faces/component/UIDataTest.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIData.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIData.java?rev=933753&r1=933752&r2=933753&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIData.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIData.java Tue Apr 13 19:19:14
2010
@@ -1193,26 +1193,24 @@ public class UIData extends UIComponentB
                             return true;
                         }
                     }
-                    // process the component's children's facets
+                    // visit every column directly without visiting its children 
+                    // (the children of every UIColumn will be visited later for 
+                    // every row) and also visit the column's facets
                     for (UIComponent child : getChildren())
                     {
-                        // visit the children's facets
-                        for (UIComponent facet : child.getFacets().values())
+                        if (child instanceof UIColumn)
                         {
-                            if (facet.visitTree(context, callback))
+                            VisitResult columnResult = context.invokeVisitCallback(child,
callback);
+                            if (columnResult == VisitResult.COMPLETE)
                             {
                                 return true;
                             }
-                        }
-                    }
-                    // visit the columns
-                    for (UIComponent child : getChildren())
-                    {
-                        if (child instanceof UIColumn)
-                        {
-                            if (child.visitTree(context, callback))
+                            for (UIComponent facet : child.getFacets().values())
                             {
-                                return true;
+                                if (facet.visitTree(context, callback))
+                                {
+                                    return true;
+                                }
                             }
                         }
                     }

Modified: myfaces/core/trunk/api/src/test/java/javax/faces/component/UIDataTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/test/java/javax/faces/component/UIDataTest.java?rev=933753&r1=933752&r2=933753&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/test/java/javax/faces/component/UIDataTest.java (original)
+++ myfaces/core/trunk/api/src/test/java/javax/faces/component/UIDataTest.java Tue Apr 13
19:19:14 2010
@@ -416,10 +416,8 @@ public class UIDataTest extends Abstract
         EasyMock.expect(visitContextMock.invokeVisitCallback(headerFacet, callback)).andReturn(VisitResult.ACCEPT);
         EasyMock.expect(visitContextMock.invokeVisitCallback(footerFacet, callback)).andReturn(VisitResult.ACCEPT);
         EasyMock.expect(visitContextMock.invokeVisitCallback(facetOfChild1, callback)).andReturn(VisitResult.ACCEPT);
-        // HACK: Expected twice because of MYFACES-2475
-        EasyMock.expect(visitContextMock.invokeVisitCallback(facetOfChild1, callback)).andReturn(VisitResult.ACCEPT);
         EasyMock.expect(visitContextMock.invokeVisitCallback(child1, callback)).andReturn(VisitResult.ACCEPT);
-        EasyMock.expect(visitContextMock.invokeVisitCallback(childOfChild1, callback)).andReturn(VisitResult.ACCEPT).times(3);
+        EasyMock.expect(visitContextMock.invokeVisitCallback(childOfChild1, callback)).andReturn(VisitResult.ACCEPT).times(2);
         control.replay();
         
         uidata.visitTree(visitContextMock, callback);



Mime
View raw message