Author: Alex.Kolonitsky
Date: 2009-11-09 07:53:55 -0500 (Mon, 09 Nov 2009)
New Revision: 15853
Modified:
branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/pom.xml
branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
RF-7990 - JS error when style attribute is set to rich:menuItem
Modified: branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/pom.xml 2009-11-09 08:44:51
UTC (rev 15852)
+++ branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/pom.xml 2009-11-09 12:53:55
UTC (rev 15853)
@@ -1,4 +1,5 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>samples</artifactId>
<groupId>org.richfaces</groupId>
@@ -13,25 +14,34 @@
<finalName>dropdownmenu-sample</finalName>
</build>
<dependencies>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>core</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
+ <artifactId>core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
<artifactId>dropdown-menu</artifactId>
- <version>${project.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>menu-components</artifactId>
- <version>${project.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.richfaces.samples</groupId>
<artifactId>skins</artifactId>
- <version>${project.version}</version>
+ <version>${project.version}</version>
</dependency>
+
+ <!-- for RF-7990 -->
+<!--
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>toolBar</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+-->
</dependencies>
</project>
\ No newline at end of file
Modified:
branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java
===================================================================
---
branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java 2009-11-09
08:44:51 UTC (rev 15852)
+++
branches/sandbox/3.3.X_JSF2/samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java 2009-11-09
12:53:55 UTC (rev 15853)
@@ -22,7 +22,6 @@
package org.richfaces.samples.dropdownmenu;
import javax.faces.event.ActionEvent;
-import org.richfaces.component.UIMenuItem;
/**
* @author $Autor$
@@ -101,7 +100,7 @@
public void setHorizontalOffsets(String horizontalOffsets) {
this.horizontalOffsets = horizontalOffsets;
- setHorizontalOffset(new Integer(this.horizontalOffsets).intValue());
+ setHorizontalOffset(Integer.parseInt(this.horizontalOffsets));
}
public String getHorizontalOffsets() {
@@ -110,7 +109,7 @@
public void setVerticalOffsets(String verticalOffsets) {
this.verticalOffsets = verticalOffsets;
- setVerticalOffset(new Integer(this.verticalOffsets).intValue());
+ setVerticalOffset(Integer.parseInt(this.verticalOffsets));
}
public String getVerticalOffsets() {
Modified:
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
---
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2009-11-09
08:44:51 UTC (rev 15852)
+++
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2009-11-09
12:53:55 UTC (rev 15853)
@@ -49,6 +49,7 @@
import org.richfaces.component.UIMenuItem;
import org.richfaces.component.util.ViewUtil;
import org.richfaces.renderkit.CompositeRenderer;
+import org.richfaces.json.JSONObject;
public class MenuItemRendererBase extends CompositeRenderer {
@@ -354,4 +355,8 @@
ComponentsVariableResolver.getVariables(this, menuItem);
delegate.initializeStyles(context, menuItem, menuItem.isDisabled(), variables);
}
+
+ public static String toJson(Map map) {
+ return new JSONObject(map).toString();
+ }
}
Modified:
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
---
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2009-11-09
08:44:51 UTC (rev 15852)
+++
branches/sandbox/3.3.X_JSF2/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2009-11-09
12:53:55 UTC (rev 15853)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<f:root
xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c="
http://java.sun.com/jsf/core"
- xmlns:ui="
http://ajax4jsf.org/cdk/ui"
- xmlns:u="
http://ajax4jsf.org/cdk/u"
- xmlns:x="
http://ajax4jsf.org/cdk/x"
+
xmlns:c="http://java.sun.com/jsf/core"
+
xmlns:ui="http://ajax4jsf.org/cdk/ui"
+
xmlns:u="http://ajax4jsf.org/cdk/u"
+
xmlns:x="http://ajax4jsf.org/cdk/x"
baseclass="org.richfaces.renderkit.html.MenuItemRendererBase"
class="org.richfaces.renderkit.html.MenuItemRenderer"
component="org.richfaces.component.UIMenuItem"
@@ -82,8 +82,8 @@
<div id="#{clientId}"
class="#{menuItemClass}"
- onmouseout="RichFaces.Menu.Utils.itemMouseOut(event, this,
#{onmouseoutClasses});"
- onmouseover="RichFaces.Menu.Utils.itemMouseOver(event, this,
#{onmouseoverClasses});"
+ onmouseout="RichFaces.Menu.Utils.itemMouseOut(event, this,
#{this:toJson(onmouseoutClasses)});"
+ onmouseover="RichFaces.Menu.Utils.itemMouseOver(event, this,
#{this:toJson(onmouseoverClasses)});"
onclick="#{onclick}"
style="#{menuItemStyle}">
<f:call name="utils.encodeAttributes">