You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ba...@apache.org on 2005/09/23 12:54:44 UTC
svn commit: r291099 -
/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
Author: baranda
Date: Fri Sep 23 03:54:35 2005
New Revision: 291099
URL: http://svn.apache.org/viewcvs?rev=291099&view=rev
Log:
Fixes MYFACES-588
Modified:
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java?rev=291099&r1=291098&r2=291099&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java Fri Sep 23 03:54:35 2005
@@ -180,57 +180,60 @@
writer.append("_cmSplit,");
}
- writer.append("[");
- if (item.getIcon() != null)
+ if (!item.isSplit())
{
- String iconSrc = context.getApplication().getViewHandler().getResourceURL(context, item.getIcon());
- writer.append("'<img src=\"");
- writer.append(context.getExternalContext().encodeResourceURL(iconSrc));
- writer.append("\"/>'");
- }
- else
- {
- writer.append("null");
- }
- writer.append(", '");
- if( item.getLabel() != null ) {
- writer.append(JavascriptUtils.encodeString(item.getLabel()));
- }
- writer.append("', ");
- if (item.getAction() != null && ! item.isDisabled())
- {
- writer.append("'");
- writer.append(menuId);
- writer.append(':');
- writer.append(item.getAction());
- if (uiNavMenuItem != null) {
- encodeValueBinding(writer, uiNavMenuItem, item);
+ writer.append("[");
+ if (item.getIcon() != null)
+ {
+ String iconSrc = context.getApplication().getViewHandler().getResourceURL(context, item.getIcon());
+ writer.append("'<img src=\"");
+ writer.append(context.getExternalContext().encodeResourceURL(iconSrc));
+ writer.append("\"/>'");
}
- writer.append("'");
- }
- else
- {
- writer.append("null");
- }
- writer.append(", 'linkDummyForm', null"); // TODO Change here to allow the use of non dummy form if possible.
-
- if (item.isRendered() && ! item.isDisabled()) {
- // render children only if parent is visible/enabled
- NavigationMenuItem[] menuItems = item.getNavigationMenuItems();
- if (menuItems != null && menuItems.length > 0)
+ else
+ {
+ writer.append("null");
+ }
+ writer.append(", '");
+ if( item.getLabel() != null ) {
+ writer.append(JavascriptUtils.encodeString(item.getLabel()));
+ }
+ writer.append("', ");
+ if (item.getAction() != null && ! item.isDisabled())
{
- writer.append(",");
- if (uiNavMenuItem != null)
+ writer.append("'");
+ writer.append(menuId);
+ writer.append(':');
+ writer.append(item.getAction());
+ if (uiNavMenuItem != null) {
+ encodeValueBinding(writer, uiNavMenuItem, item);
+ }
+ writer.append("'");
+ }
+ else
+ {
+ writer.append("null");
+ }
+ writer.append(", 'linkDummyForm', null"); // TODO Change here to allow the use of non dummy form if possible.
+
+ if (item.isRendered() && ! item.isDisabled()) {
+ // render children only if parent is visible/enabled
+ NavigationMenuItem[] menuItems = item.getNavigationMenuItems();
+ if (menuItems != null && menuItems.length > 0)
{
- encodeNavigationMenuItems(context, writer, menuItems,
- uiNavMenuItem.getChildren(), menuId);
- } else {
- encodeNavigationMenuItems(context, writer, menuItems,
- new ArrayList(1), menuId);
- }
+ writer.append(",");
+ if (uiNavMenuItem != null)
+ {
+ encodeNavigationMenuItems(context, writer, menuItems,
+ uiNavMenuItem.getChildren(), menuId);
+ } else {
+ encodeNavigationMenuItems(context, writer, menuItems,
+ new ArrayList(1), menuId);
+ }
+ }
}
+ writer.append("]");
}
- writer.append("]");
}
}