Author: F.antonov
Date: 2007-04-03 09:49:20 -0400 (Tue, 03 Apr 2007)
New Revision: 245
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
Log:
MenuItem component development.
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
---
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-04-03
13:48:54 UTC (rev 244)
+++
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-04-03
13:49:20 UTC (rev 245)
@@ -103,20 +103,19 @@
+ getStringAttributeOrEmptyString(menuItem, "iconClass");
variables.setVariable("iconClass", resource);
- resource = "dr-menu-label dr-menu-label-disabled rich-menu-item-label
rich-menu-item-label-disabled";
- // + (String) menuItem.getAttributes().get("iconClass");
+ resource = "dr-menu-label dr-menu-label-disabled rich-menu-item-label
rich-menu-item-label-disabled";
variables.setVariable("labelClass", resource);
+ variables.setVariable("onclick", "Event.stop(event ||
window.event);");
+
} else {
StringBuffer scriptValue = new StringBuffer();
scriptValue.append("this.className='dr-menu-item dr-menu-item-enabled
rich-menu-item rich-menu-item-enabled ")
.append(getStringAttributeOrEmptyString(menuItem, "styleClass") +
"'; ");
- processInlineStyles(context, menuItem, scriptValue, false);
- //if (null == getIconFacet(menuItem)) {
- scriptValue.append("document.getElementById('" +
menuItem.getClientId(context) + ":icon').className='dr-menu-icon
rich-menu-item-icon ")
- .append(getStringAttributeOrEmptyString(menuItem, "iconClass") +
"'; ");
- //}
+ processInlineStyles(context, menuItem, scriptValue, false);
+ scriptValue.append("document.getElementById('" +
menuItem.getClientId(context) + ":icon').className='dr-menu-icon
rich-menu-item-icon ")
+ .append(getStringAttributeOrEmptyString(menuItem, "iconClass") +
"'; ");
scriptValue.append("document.getElementById('" +
menuItem.getClientId(context) + ":anchor').className='dr-menu-label
rich-menu-item-label'; ")
.append(getStringAttributeOrEmptyString(menuItem, "onmouseout"));
variables.setVariable("onmouseout", scriptValue);
@@ -125,11 +124,9 @@
scriptValue.append("this.className='dr-menu-item dr-menu-item-hover
rich-menu-item rich-menu-item-hover ")
.append(getStringAttributeOrEmptyString(menuItem, "styleClass") + "
")
.append(getStringAttributeOrEmptyString(menuItem, "selectClass") +
"'; ");
- processInlineStyles(context, menuItem, scriptValue, true);
- //if (null == getIconFacet(menuItem)) {
- scriptValue.append("document.getElementById('" +
menuItem.getClientId(context) + ":icon').className='dr-menu-icon
dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected ")
- .append(getStringAttributeOrEmptyString(menuItem, "iconClass") +
"'; ");
- //}
+ processInlineStyles(context, menuItem, scriptValue, true);
+ scriptValue.append("document.getElementById('" +
menuItem.getClientId(context) + ":icon').className='dr-menu-icon
dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected ")
+ .append(getStringAttributeOrEmptyString(menuItem, "iconClass") +
"'; ");
scriptValue.append("document.getElementById('" +
menuItem.getClientId(context) + ":anchor').className='dr-menu-label
dr-menu-label-selected rich-menu-item-label rich-menu-item-label-selected'; ")
.append(getStringAttributeOrEmptyString(menuItem, "onmouseout"));
variables.setVariable("onmouseover", scriptValue);
@@ -143,13 +140,13 @@
variables.setVariable("iconClass", resource);
resource = "dr-menu-label rich-menu-item-label";
- // + (String) menuItem.getAttributes().get("iconClass");
variables.setVariable("labelClass", resource);
resource = null;
String mode = resolveSubmitMode(menuItem);
if (mode.equalsIgnoreCase(UIMenuItem.MODE_AJAX)) {
resource = AjaxRendererUtils.buildOnClick(menuItem, context).toString();
+ //resource += "; Exadel.Menu.Layers.shutdown();return false;";
} else if (mode.equalsIgnoreCase(UIMenuItem.MODE_SERVER)) {
CommandScriptBuilder builder = new CommandScriptBuilder(menuItem);
builder.setCheckActionAndListener(true);
@@ -160,7 +157,7 @@
builder.setUseOriginalOnclick(true);
builder.addCodeBefore("Event.stop(event || window.event);");
//builder.addCodeAfter("Exadel.Menu.Layers.shutdown();return false;");
- String id = menuItem.getClientId(context);// + ":submit";
+ String id = menuItem.getClientId(context);
builder.addParameter(id + ":hidden", id);
resource = builder.toString();
}
Show replies by date