myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r990487 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/panelstack/HtmlPanelStackRenderer.java
Date Sun, 29 Aug 2010 04:25:49 GMT
Author: lu4242
Date: Sun Aug 29 04:25:48 2010
New Revision: 990487

URL: http://svn.apache.org/viewvc?rev=990487&view=rev
Log:
if panelstack receives "" it fails because UIComponent.findComponent throws IllegalStateException

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/panelstack/HtmlPanelStackRenderer.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/panelstack/HtmlPanelStackRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/panelstack/HtmlPanelStackRenderer.java?rev=990487&r1=990486&r2=990487&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/panelstack/HtmlPanelStackRenderer.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/panelstack/HtmlPanelStackRenderer.java
Sun Aug 29 04:25:48 2010
@@ -63,13 +63,7 @@ public class HtmlPanelStackRenderer exte
         String selectedPanel = panelStack.getSelectedPanel();
         UIComponent childToRender = null;
 
-        if (selectedPanel == null)
-        {
-            // render the first child
-            if (panelStack.getChildCount() > 0) {
-                childToRender = (UIComponent) panelStack.getChildren().get(0);
-            }
-        } else
+        if (selectedPanel != null && selectedPanel.length() > 0)
         {
             // render the selected child
             childToRender = panelStack.findComponent(selectedPanel);
@@ -81,6 +75,13 @@ public class HtmlPanelStackRenderer exte
                 }
             }
         }
+        else
+        {
+            // render the first child
+            if (panelStack.getChildCount() > 0) {
+                childToRender = (UIComponent) panelStack.getChildren().get(0);
+            }
+        }
 
         if (childToRender != null)
         {



Mime
View raw message