Author: vbaranov
Date: 2008-03-18 09:16:11 -0400 (Tue, 18 Mar 2008)
New Revision: 6903
Modified:
branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
Log:
http://jira.jboss.com/jira/browse/RF-2546
Modified:
branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
---
branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2008-03-18
12:56:56 UTC (rev 6902)
+++
branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2008-03-18
13:16:11 UTC (rev 6903)
@@ -86,6 +86,20 @@
return params;
}
+
+ 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", Boolean.FALSE);
+ }
+ }
+ }
public void insertScript(FacesContext context, UIComponent component)
throws IOException {
Modified:
branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
---
branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2008-03-18
12:56:56 UTC (rev 6902)
+++
branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2008-03-18
13:16:11 UTC (rev 6903)
@@ -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){