Author: vbaranov
Date: 2008-03-06 05:21:19 -0500 (Thu, 06 Mar 2008)
New Revision: 6583
Modified:
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
Log:
http://jira.jboss.com/jira/browse/RF-2192
Modified:
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
---
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2008-03-06
10:12:04 UTC (rev 6582)
+++
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2008-03-06
10:21:19 UTC (rev 6583)
@@ -85,8 +85,23 @@
return params;
}
+
+ @Override
+ protected void preEncodeBegin(FacesContext context, UIComponent component) throws
IOException {
+ super.preEncodeBegin(context, component);
+
+ // In case of encoding the UIPanelMenu in "expandSingle=true" mode
+ // the value of "firstExpandedEncoded" attribute should be reset to
+ // initial "false" state
+ if (component instanceof UIPanelMenu) {
+ UIPanelMenu panelMenu = (UIPanelMenu) component;
+ if (panelMenu.isExpandSingle()) {
+ panelMenu.getAttributes().put("firstExpandedEncoded", false);
+ }
+ }
+ }
+
-
public void insertScript(FacesContext context, UIComponent component)
throws IOException {
@@ -504,7 +519,7 @@
}
public void renderChildren(FacesContext facesContext, UIComponent component)throws
IOException {
-
+
if(component instanceof UIPanelMenu){
UIPanelMenu panelMenu = (UIPanelMenu)component;
if(panelMenu.getChildCount() > 0){
Modified:
trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
---
trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2008-03-06
10:12:04 UTC (rev 6582)
+++
trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2008-03-06
10:21:19 UTC (rev 6583)
@@ -286,9 +286,11 @@
this.expand();
}
}
- if (this.action){
- this.trigger(e);
- }
+ // trigger event not only for action, but also for actionListener
+ this.trigger(e);
+ //if (this.action){
+ // this.trigger(e);
+ //}
this.parentObj.lastExpanded = this;
} else {
if ("node" == this.type){