Author: abelevich
Date: 2011-01-25 05:44:54 -0500 (Tue, 25 Jan 2011)
New Revision: 21190
Modified:
trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
trunk/ui/output/ui/src/main/templates/menuitem.template.xml
Log:
RF-10236 Drop down menu: f:param is not working inside menuitem
Modified: trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml 2011-01-25
01:09:50 UTC (rev 21189)
+++ trunk/examples/output-demo/src/main/webapp/examples/dropDownMenu.xhtml 2011-01-25
10:44:54 UTC (rev 21190)
@@ -46,7 +46,10 @@
<h:outputText style="font-weight:bold"
value="#{menuBean.current}"></h:outputText>
</a4j:outputPanel>
<br />
- <ddm:dropDownMenu hideDelay="600" showEvent="click"
jointPoint="bottomLeft" direction="autoRight" id="ddmenu"
disabled="#{menuBean.disabled}" mode="#{menuBean.mode}">
+ <ddm:dropDownMenu hideDelay="600" showEvent="click"
+ jointPoint="bottomLeft" direction="autoRight"
+ id="ddmenu" disabled="#{menuBean.disabled}"
+ mode="#{menuBean.mode}">
<f:facet name="label">
<h:panelGroup>
<h:graphicImage value="/images/ddmenu/copy.gif"
styleClass="pic"/>
@@ -64,6 +67,8 @@
<f:facet name="icon">
<h:selectBooleanCheckbox id="checkbox"
value="#{menuBean.checkbox}"/>
</f:facet>
+ <f:param name="myParam" value="12345"/>
+ <f:param name="myParam2" value="${222}"/>
</ddm:menuItem>
<ddm:menuItem label="Open"
action="#{menuBean.doOpen}">
<f:facet name="icon">
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-25
01:09:50 UTC (rev 21189)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-25
10:44:54 UTC (rev 21190)
@@ -52,17 +52,18 @@
this.__getParentMenu().processItem(this.element);
}
- this.__submitForm(rf.getDomElement(this.id), e);
+ this.__submitForm(rf.getDomElement(this.id), e, this.options.params);
},
/**
*
* @param item DOM element
*/
- __submitForm : function(item, e) {
+ __submitForm : function(item, e, params) {
var form = this.__getParentForm(item);
var itemId = {};
itemId[item.id] = item.id;
+ $.extend(itemId, params || {});
if (this.options.mode == "server") {
rf.submitForm(form, itemId);
}
Modified: trunk/ui/output/ui/src/main/templates/menuitem.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-25 01:09:50 UTC
(rev 21189)
+++ trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-25 10:44:54 UTC
(rev 21190)
@@ -19,7 +19,7 @@
<cdk:resource-dependency name="richfaces-event.js" />
<cdk:resource-dependency name="menuitem.js"
library="org.richfaces" />
-
+ <cdk:import package="org.richfaces.renderkit.util"
names="RendererUtils" />
</cc:interface>
<cc:implementation>
@@ -80,6 +80,7 @@
<c:when test="#{not isDisabled}">
<script type="text/javascript">
<cdk:scriptObject name="options">
+ <cdk:scriptOption name="params"
value="${RendererUtils.getInstance().createParametersMap(facesContext,
component)}"/>
<cdk:scriptOption name="mode"
value="#{getSubmitMode(component)}"
defaultValue="org.richfaces.component.Mode.server"/>
<cdk:scriptOption name="submitFunction"
value="#{getOnClickFunction(facesContext, component)}"
wrapper="eventHandler"/>
</cdk:scriptObject>