Author: artdaw
Date: 2011-02-01 10:23:29 -0500 (Tue, 01 Feb 2011)
New Revision: 21361
Modified:
trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
Log:
RF-10313: @bubbleSelection and @expandSingle are removed from PanelMenuGroup. These
options are passed from PanelMenu.
Modified: trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-02-01
15:10:32 UTC (rev 21360)
+++ trunk/examples/output-demo/src/main/webapp/examples/panelMenu.xhtml 2011-02-01
15:23:29 UTC (rev 21361)
@@ -49,8 +49,10 @@
itemDisabledLeftIcon="triangleLeft"
topItemDisabledLeftIcon="triangleUp"
topItemLeftIcon="triangleDown"
- groupMode="client" activeItem="item41">
- <rich:panelMenuGroup id="group1" label="Group 1"
disabled="true">
+ groupMode="client" activeItem="item41"
+ bubbleSelection="true"
+ expandSingle="true">
+ <rich:panelMenuGroup id="group1" label="Group 1">
<rich:panelMenuItem id="item11" label="Item 1.1" />
<rich:panelMenuItem id="item12" label="Item 1.2" />
</rich:panelMenuGroup>
Modified:
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js
===================================================================
---
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js 2011-02-01
15:10:32 UTC (rev 21360)
+++
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-panel-menu-group-qunit.js 2011-02-01
15:23:29 UTC (rev 21361)
@@ -35,8 +35,6 @@
// test default options
same(c.options.expandEvent, "click", "Expand Event");
same(c.options.collapseEvent, "click", "Collapse Event");
- same(c.options.expandSingle, false, "Expand Single");
- same(c.options.bubbleSelection, {}, "Bubble Selection");
});
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-02-01
15:10:32 UTC (rev 21360)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-02-01
15:23:29 UTC (rev 21361)
@@ -159,18 +159,12 @@
@Attribute(defaultValue = "getPanelMenu().getGroupMode()")
public abstract PanelMenuMode getMode();
- @Attribute(defaultValue = "getPanelMenu().isExpandSingle()")
- public abstract boolean isExpandSingle();
-
@Attribute
public abstract String getCollapseEvent();
@Attribute
public abstract String getExpandEvent();
- @Attribute(defaultValue = "getPanelMenu().isBubbleSelection()")
- public abstract boolean isBubbleSelection();
-
@Attribute
public abstract MethodExpression getChangeExpandListener();
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2011-02-01
15:10:32 UTC (rev 21360)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2011-02-01
15:23:29 UTC (rev 21361)
@@ -23,25 +23,7 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.DIV_ELEM;
-import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.INPUT_ELEM;
-import static org.richfaces.renderkit.HtmlConstants.INPUT_TYPE_HIDDEN;
-import static org.richfaces.renderkit.HtmlConstants.NAME_ATTRIBUTE;
-import static org.richfaces.renderkit.HtmlConstants.TYPE_ATTR;
-import static org.richfaces.renderkit.HtmlConstants.VALUE_ATTRIBUTE;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
+import com.google.common.base.Strings;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSObject;
import org.ajax4jsf.javascript.ScriptUtils;
@@ -51,8 +33,17 @@
import org.richfaces.component.AbstractPanelMenuItem;
import org.richfaces.renderkit.HtmlConstants;
-import com.google.common.base.Strings;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import static org.richfaces.renderkit.HtmlConstants.*;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
/**
* @author akolonitsky
* @since 2010-10-25
@@ -197,8 +188,6 @@
options.put("disabled", panelMenuGroup.isDisabled());
options.put("expandEvent", getExpandEvent(panelMenuGroup));
options.put("collapseEvent", getCollapseEvent(panelMenuGroup));
- options.put("expandSingle", panelMenuGroup.isExpandSingle());
- options.put("bubbleSelection", panelMenuGroup.isBubbleSelection());
options.put("expanded", panelMenuGroup.isExpanded());
options.put("selectable", panelMenuGroup.isSelectable());
options.put("unselectable", panelMenuGroup.isUnselectable());
@@ -240,11 +229,11 @@
if (component instanceof AbstractPanelMenuGroup) {
AbstractPanelMenuGroup group = (AbstractPanelMenuGroup) component;
- if (!group.isBubbleSelection()) {
+ if (!group.getPanelMenu().isBubbleSelection()) {
return false;
}
}
-
+
if (component.getChildCount() > 0) {
for (UIComponent child : component.getChildren()) {
if (!child.isRendered()) {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-02-01
15:10:32 UTC (rev 21360)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-02-01
15:23:29 UTC (rev 21361)
@@ -23,26 +23,25 @@
package org.richfaces.renderkit.html;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractPanelMenu;
+import org.richfaces.component.AbstractPanelMenuItem;
+import org.richfaces.context.ExtendedPartialViewContext;
+import org.richfaces.renderkit.HtmlConstants;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
-import org.ajax4jsf.javascript.JSObject;
-import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.component.AbstractPanelMenu;
-import org.richfaces.component.AbstractPanelMenuItem;
-import org.richfaces.context.ExtendedPartialViewContext;
-import org.richfaces.renderkit.HtmlConstants;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
/**
* @author akolonitsky
@@ -133,7 +132,7 @@
options.put("ajax", getAjaxOptions(context, panelMenu));
options.put("disabled", panelMenu.isDisabled());
options.put("expandSingle", panelMenu.isExpandSingle());
-
+ options.put("bubbleSelection", panelMenu.isBubbleSelection());
return options;
}
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2011-02-01
15:10:32 UTC (rev 21360)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2011-02-01
15:23:29 UTC (rev 21361)
@@ -26,7 +26,8 @@
rf.ui = rf.ui || {};
var __DEFAULT_OPTIONS = {
- expandSingle : true
+ expandSingle : true,
+ bubbleSelection : true
};
rf.ui.PanelMenu = rf.BaseComponent.extendClass({
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-02-01
15:10:32 UTC (rev 21360)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-02-01
15:23:29 UTC (rev 21361)
@@ -27,8 +27,6 @@
var __DEFAULT_OPTIONS = {
expanded : false,
- expandSingle : true,
- bubbleSelection : true,
stylePrefix : "rf-pm-gr",
expandEvent: "click",
collapseEvent: "click",
@@ -124,6 +122,9 @@
init : function (componentId, options) {
$super.constructor.call(this, componentId, $.extend({}, __DEFAULT_OPTIONS,
options || {}));
+ this.options.bubbleSelection = this.__rfPanelMenu().options.bubbleSelection;
+ this.options.expandSingle = this.__rfPanelMenu().options.expandSingle;
+
if (!this.options.disabled) {
var menuGroup = this;