Author: F.antonov
Date: 2007-04-04 09:24:20 -0400 (Wed, 04 Apr 2007)
New Revision: 267
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-04
12:00:33 UTC (rev 266)
+++
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-04-04
13:24:20 UTC (rev 267)
@@ -142,12 +142,13 @@
resource = "dr-menu-label rich-menu-item-label";
variables.setVariable("labelClass", resource);
- resource = null;
+ scriptValue = new StringBuffer();
+ scriptValue.append(getStringAttributeOrEmptyString(menuItem, "onselect"));
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)) {
+ scriptValue.append(AjaxRendererUtils.buildOnClick(menuItem, context).toString());
+ //scriptValue.append("; Exadel.Menu.Layers.shutdown();return false;");
+ } else if (mode.equalsIgnoreCase(UIMenuItem.MODE_SERVER)) {
CommandScriptBuilder builder = new CommandScriptBuilder(menuItem);
builder.setCheckActionAndListener(true);
Object target = menuItem.getAttributes().get("target");
@@ -159,11 +160,15 @@
//builder.addCodeAfter("Exadel.Menu.Layers.shutdown();return false;");
String id = menuItem.getClientId(context);
builder.addParameter(id + ":hidden", id);
- resource = builder.toString();
+ scriptValue.append(builder.toString());
+ } else {
+ scriptValue.append("; " + getStringAttributeOrEmptyString(menuItem,
"onclick"));
}
- if (resource != null) {
- variables.setVariable("onclick", resource);
+ if (resource.length() > 0) {
+ variables.setVariable("onclick", scriptValue.toString());
}
+
+ variables.setVariable("value", getStringAttributeOrEmptyString(menuItem,
"value"));
}
}
Show replies by date