myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r906333 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
Date Thu, 04 Feb 2010 03:14:56 GMT
Author: lu4242
Date: Thu Feb  4 03:14:55 2010
New Revision: 906333

URL: http://svn.apache.org/viewvc?rev=906333&view=rev
Log:
MYFACES-2534 ComponentSupport.addFacet adds a panel when there is only one component as a
child

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java?rev=906333&r1=906332&r2=906333&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
Thu Feb  4 03:14:55 2010
@@ -356,22 +356,10 @@
         // facets now can have multiple children and the direct
         // child of a facet is always an UIPanel (since 2.0)
         UIComponent facet = parent.getFacets().get(facetName);
-        boolean facetChanged = false;
-        
         if (facet == null)
         {
-            // if our component is an instance of UIPanel, use it
-            if (c instanceof UIPanel)
-            {
-                facet = c;
-            }
-            else
-            {
-                // create a new UIPanel and add c as child
-                facet = createFacetUIPanel(ctx.getFacesContext());
-                facet.getChildren().add(c);
-            }
-            facetChanged = true;
+            //Just set it directly like  before
+            parent.getFacets().put(facetName, c);
         }
         else if (!(facet instanceof UIPanel))
         {
@@ -380,7 +368,7 @@
             facet = createFacetUIPanel(ctx.getFacesContext());
             facet.getChildren().add(child);
             facet.getChildren().add(c);
-            facetChanged = true;
+            parent.getFacets().put(facetName, facet);
         }
         else
         {
@@ -398,14 +386,9 @@
                 facet = createFacetUIPanel(ctx.getFacesContext());
                 facet.getChildren().add(oldPanel);
                 facet.getChildren().add(c);
-                facetChanged = true;
+                parent.getFacets().put(facetName, facet);
             }
         }
-        
-        if (facetChanged)
-        {
-            parent.getFacets().put(facetName, facet);
-        }        
     }
     
     public static void removeFacet(FaceletContext ctx, UIComponent parent, UIComponent c,
String facetName)



Mime
View raw message