myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject svn commit: r330076 - /myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanel.java
Date Tue, 01 Nov 2005 15:34:34 GMT
Author: mmarinschek
Date: Tue Nov  1 07:34:30 2005
New Revision: 330076

URL: http://svn.apache.org/viewcvs?rev=330076&view=rev
Log:
reviewed CollapsiblePanel

Modified:
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanel.java

Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanel.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanel.java?rev=330076&r1=330075&r2=330076&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanel.java
(original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanel.java
Tue Nov  1 07:34:30 2005
@@ -15,18 +15,12 @@
  */
 package org.apache.myfaces.custom.collapsiblepanel;
 
-import javax.faces.component.html.HtmlPanelGroup;
 import javax.faces.component.UIComponent;
-import javax.faces.component.EditableValueHolder;
 import javax.faces.component.UIInput;
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
-import javax.faces.el.MethodBinding;
-import javax.faces.validator.Validator;
-import javax.faces.event.ValueChangeListener;
-import javax.faces.convert.Converter;
-import java.util.Iterator;
 import java.io.IOException;
+import java.util.Iterator;
 
 /**
  * @author Kalle Korhonen (latest modification by $Author$)
@@ -44,7 +38,32 @@
 
         if (!isRendered()) return;
 
-        if(isCollapsed())
+        try
+        {
+            decode(context);
+        }
+        catch (RuntimeException e)
+        {
+            context.renderResponse();
+            throw e;
+        }
+
+        UIComponent headerComponent = getFacet("header");
+
+        if(headerComponent != null)
+        {
+            for (Iterator it = headerComponent.getChildren().iterator(); it.hasNext(); )
+            {
+                UIComponent child = (UIComponent)it.next();
+
+                if(!(child instanceof HtmlHeaderLink))
+                {
+                    child.processDecodes(context);
+                }
+            }
+        }
+
+        if(getSubmittedValue()!=null?isCollapsed(getSubmittedValue()):isCollapsed(getValue()))
         {
             UIComponent component = getFacet("closedContent");
 
@@ -61,16 +80,6 @@
                 child.processDecodes(context);
             }
         }
-
-        try
-        {
-            decode(context);
-        }
-        catch (RuntimeException e)
-        {
-            context.renderResponse();
-            throw e;
-        }
     }
 
     public String getClientId(FacesContext context)
@@ -162,7 +171,12 @@
 
     public boolean isCollapsed()
     {
-        Object value = getValue();
+        return isCollapsed(getValue());
+    }
+
+    private static boolean isCollapsed(Object collapsedValue)
+    {
+        Object value = collapsedValue;
 
         if(value instanceof Boolean)
         {



Mime
View raw message