Author: d.bulahov
Date: 2007-05-03 06:17:32 -0400 (Thu, 03 May 2007)
New Revision: 626
Modified:
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/MenuComponent.java
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
trunk/richfaces/menu-components/src/test/java/org/richfaces/renderkit/html/MenuItemRendererBaseTest.java
Log:
http://jira.jboss.com/jira/browse/RF-142?page=all fixed
Modified: trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml
===================================================================
---
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-05-03
10:17:21 UTC (rev 625)
+++
trunk/richfaces/menu-components/src/main/config/component/menucomponents.xml 2007-05-03
10:17:32 UTC (rev 626)
@@ -195,10 +195,11 @@
<description>Defines representation text for
menuItem</description>
</property -->
<property>
- <name>mode</name>
+ <name>submitMode</name>
<classname>java.lang.String</classname>
<description>Set the submission mode (ajax, server(Default),
none)</description>
+ <defaultvalue>"server"</defaultvalue>
</property>
<!-- Command attributes -->
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/MenuComponent.java
===================================================================
---
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/MenuComponent.java 2007-05-03
10:17:21 UTC (rev 625)
+++
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/MenuComponent.java 2007-05-03
10:17:32 UTC (rev 626)
@@ -39,6 +39,6 @@
/**
* Getter for submit mode property.
*/
- public String getMode();
+ public String getSubmitMode();
}
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java
===================================================================
---
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java 2007-05-03
10:17:21 UTC (rev 625)
+++
trunk/richfaces/menu-components/src/main/java/org/richfaces/component/UIMenuItem.java 2007-05-03
10:17:32 UTC (rev 626)
@@ -37,8 +37,8 @@
public static final String COMPONENT_TYPE = "org.richfaces.MenuItem";
- public abstract String getMode();
- public abstract void setMode(String mode);
+ public abstract String getSubmitMode();
+ public abstract void setSubmitMode(String submitMode);
public abstract Object getValue();
public abstract void setValue(Object value);
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-05-03
10:17:21 UTC (rev 625)
+++
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-05-03
10:17:32 UTC (rev 626)
@@ -65,7 +65,7 @@
// enqueue event here for this component or for component with Id
// taken from forId attribute
- String mode = menuItem.getMode();
+ String mode = menuItem.getSubmitMode();
if (!MenuComponent.MODE_NONE.equalsIgnoreCase(mode)) {
ActionEvent actionEvent = new ActionEvent(menuItem);
@@ -154,14 +154,14 @@
}
protected String resolveSubmitMode(UIMenuItem menuItem) {
- String submitMode = menuItem.getMode();
+ String submitMode = menuItem.getSubmitMode();
if (null != submitMode) {
return submitMode;
}
UIComponent parent = menuItem.getParent();
while (null != parent) {
if (parent instanceof MenuComponent) {
- return ((MenuComponent) parent).getMode();
+ return ((MenuComponent) parent).getSubmitMode();
}
parent = parent.getParent();
}
Modified:
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java
===================================================================
---
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03
10:17:21 UTC (rev 625)
+++
trunk/richfaces/menu-components/src/test/java/org/richfaces/component/MenuItemComponentTest.java 2007-05-03
10:17:32 UTC (rev 626)
@@ -102,7 +102,7 @@
* MenuItem rendering test.
*/
public void testMenuItemRender() throws Exception {
- menuItem.setMode(MenuComponent.MODE_NONE);
+ menuItem.setSubmitMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -191,7 +191,7 @@
public void testEnabledMenuItemServerMode() throws Exception {
assertEquals(false, menuItem.isDisabled());
menuItem.getAttributes().put("iconClass", "iconClass");
- menuItem.setMode(MenuComponent.MODE_SERVER);
+ menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
menuItem.getAttributes().put("target", "target");
menuItem.getAttributes().put("selectStyle",
"menuItemSelectStyle");
HtmlPage page = renderView();
@@ -233,7 +233,7 @@
* Test for enabled MenuItem component in "ajax" mode.
*/
public void testEnabledMenuItemAJAXMode() throws Exception {
- menuItem.setMode(MenuComponent.MODE_AJAX);
+ menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
menuItem.getAttributes().put("style", "menuItemStyle");
HtmlPage page = renderView();
assertNotNull(page);
@@ -251,7 +251,7 @@
* Test for enabled MenuItem component in "none" mode.
*/
public void testEnabledMenuItemNoneMode() throws Exception {
- menuItem.setMode(MenuComponent.MODE_NONE);
+ menuItem.setSubmitMode(MenuComponent.MODE_NONE);
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
@@ -312,7 +312,7 @@
public void testMenuItemDoDecodeAJAXMode() throws Exception {
menuItem.setImmediate(true);
- menuItem.setMode(MenuComponent.MODE_AJAX);
+ menuItem.setSubmitMode(MenuComponent.MODE_AJAX);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext), "Action");
@@ -331,7 +331,7 @@
public void testMenuItemDoDecodeServerMode() throws Exception {
menuItem.setImmediate(false);
- menuItem.setMode(MenuComponent.MODE_SERVER);
+ menuItem.setSubmitMode(MenuComponent.MODE_SERVER);
externalContext.getRequestParameterMap().put(
menuItem.getClientId(facesContext) + ":hidden",
"Action");
Modified:
trunk/richfaces/menu-components/src/test/java/org/richfaces/renderkit/html/MenuItemRendererBaseTest.java
===================================================================
---
trunk/richfaces/menu-components/src/test/java/org/richfaces/renderkit/html/MenuItemRendererBaseTest.java 2007-05-03
10:17:21 UTC (rev 625)
+++
trunk/richfaces/menu-components/src/test/java/org/richfaces/renderkit/html/MenuItemRendererBaseTest.java 2007-05-03
10:17:32 UTC (rev 626)
@@ -52,7 +52,7 @@
return null;
}
- public String getMode() {
+ public String getSubmitMode() {
return MenuComponent.MODE_AJAX;
}
@@ -91,12 +91,12 @@
* Test for resolveSubmitMode method.
*/
public void testResolveSubmitModeMethod() throws Exception {
- menuItem.setMode(null);
+ menuItem.setSubmitMode(null);
assertEquals(menuItem.getParent(), menu);
String resultMode = renderer.resolveSubmitMode(menuItem);
assertEquals(resultMode, MenuComponent.MODE_AJAX);
- menuItem.setMode(MenuComponent.MODE_NONE);
+ menuItem.setSubmitMode(MenuComponent.MODE_NONE);
resultMode = renderer.resolveSubmitMode(menuItem);
assertEquals(resultMode, MenuComponent.MODE_NONE);
}