myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r548342 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlCommandNavigationItem.java
Date Mon, 18 Jun 2007 12:34:37 GMT
Author: tomsp
Date: Mon Jun 18 05:34:36 2007
New Revision: 548342

URL: http://svn.apache.org/viewvc?view=rev&rev=548342
Log:
TOMAHAWK-1026 unclosed items issue

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlCommandNavigationItem.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlCommandNavigationItem.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlCommandNavigationItem.java?view=diff&rev=548342&r1=548341&r2=548342
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlCommandNavigationItem.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlCommandNavigationItem.java
Mon Jun 18 05:34:36 2007
@@ -170,12 +170,24 @@
 
             //open all parents (to be sure) and search HtmlPanelNavigation
             UIComponent p = parent;
+            HtmlCommandNavigationItem rootItem = null;
             while (p != null && !(p instanceof HtmlPanelNavigationMenu)) {
                 if (p instanceof HtmlCommandNavigationItem) {
-                    ((HtmlCommandNavigationItem) p).setOpen(true);
+                    rootItem = (HtmlCommandNavigationItem) p;
+                    rootItem.setOpen(true);
                 }
                 p = p.getParent();
             }
+            if (rootItem != null) {
+                List children = menu.getChildren();
+                for (int i = 0, sizei = children.size(); i < sizei; i++) {
+                    Object obj = children.get(i);
+                    if (obj != rootItem && obj instanceof HtmlCommandNavigationItem)
{
+                        ((HtmlCommandNavigationItem)obj).setOpen(false);
+                    }
+                }
+            }
+
             // p is now the HtmlPanelNavigation
             if (!(p instanceof HtmlPanelNavigationMenu)) {
                 log.error("HtmlCommandNavigation without parent HtmlPanelNavigation ?!");



Mime
View raw message