Author: Alex.Kolonitsky
Date: 2009-06-28 08:41:36 -0400 (Sun, 28 Jun 2009)
New Revision: 14739
Modified:
branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
branches/community/3.3.X/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
Log:
dropDownMenu: menuGroupItem is displayed incorrectly with attribute
disabled="true"
https://jira.jboss.org/jira/browse/RF-7383
Modified:
branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
===================================================================
---
branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java 2009-06-28
11:19:18 UTC (rev 14738)
+++
branches/community/3.3.X/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java 2009-06-28
12:41:36 UTC (rev 14739)
@@ -59,10 +59,11 @@
String selectedLabelClass = (String)
menuItem.getAttributes().get("labelClass");
if (disabled) {
+ variables.setVariable("menuGroupClass",
concatClasses("rich-menu-group rich-menu-group-disabled", itemClass,
disabledItemClass, styleClass));
+ variables.setVariable("menuGroupItemIconClass",
"rich-menu-item-icon-disabled rich-menu-group-icon");
variables.setVariable("menuItemClass", concatClasses("rich-menu-item
rich-menu-item-disabled", styleClass, itemClass, disabledItemClass));
variables.setVariable("menuItemStyle", concatStyles(itemStyle,
disabledItemStyle, style));
variables.setVariable("menuItemLabelClass",
concatClasses("rich-menu-item-label rich-menu-item-label-disabled", labelClass,
disabledLabelClass));
- variables.setVariable("menuGroupClass", concatClasses("rich-menu-group
rich-menu-group-disabled", itemClass, disabledItemClass, styleClass));
variables.setVariable("menuItemMouseMove", "");
variables.setVariable("menuItemItemIconClass",
"rich-menu-item-icon-disabled");
variables.setVariable("menuItemItemLabelClass",
concatClasses("rich-menu-item-label-disabled", labelClass));
Modified:
branches/community/3.3.X/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
---
branches/community/3.3.X/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2009-06-28
11:19:18 UTC (rev 14738)
+++
branches/community/3.3.X/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2009-06-28
12:41:36 UTC (rev 14739)
@@ -21,20 +21,36 @@
<f:call name="initializeResources" />
<f:call name="initializeStyleClasses" />
<f:resource name="/org/richfaces/renderkit/html/images/spacer.gif"
var="spacer" />
-
+
+ <jsp:scriptlet>
+ <![CDATA[
+ boolean disabled = ((Boolean)
component.getAttributes().get("disabled")).booleanValue();
+ if (disabled) {
+ ]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}"
+ class="#{menuGroupClass}"
+ style="#{menuItemStyle}"
+ onmousemove="#{menuItemMouseMove}" >
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}"
+ class="#{menuGroupClass}"
+ style="#{menuItemStyle}"
+ onmousemove="#{menuItemMouseMove}"
+ onmouseout="RichFaces.Menu.groupMouseOut(event, this,
'#{menuGroupCustomClass}', '#{onmouseoutInlineStyles}');"
+ onmouseover="RichFaces.Menu.groupMouseOver(event, this,
'#{menuGroupHoverClass}', '#{onmouseoverInlineStyles}');">
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+
+
- <div id="#{clientId}"
- class="#{menuGroupClass}"
- style="#{menuItemStyle}"
- onmousemove="#{menuItemMouseMove}"
- onmouseout="RichFaces.Menu.groupMouseOut(event, this,
'#{menuGroupCustomClass}', '#{onmouseoutInlineStyles}');"
- onmouseover="RichFaces.Menu.groupMouseOver(event, this,
'#{menuGroupHoverClass}', '#{onmouseoverInlineStyles}');">
-
<span id="#{clientId}:icon"
class="#{menuGroupItemIconClass}
#{component.attributes['iconClass']}">
<jsp:scriptlet>
<![CDATA[
- boolean disabled = ((Boolean)
component.getAttributes().get("disabled")).booleanValue();
String iconName = disabled ? "iconDisabled" : "icon";
UIComponent iconFacet = component.getFacet(iconName);
if (iconFacet !=null && iconFacet.isRendered()) {
@@ -91,6 +107,18 @@
<jsp:scriptlet>
<![CDATA[}]]>
</jsp:scriptlet>
- </div>
+ <jsp:scriptlet>
+ <![CDATA[if (disabled) {]]>
+ </jsp:scriptlet>
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+
+
</f:root>