Author: ppitonak(a)redhat.com
Date: 2010-12-06 14:13:42 -0500 (Mon, 06 Dec 2010)
New Revision: 20421
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
Log:
https://jira.jboss.org/browse/RF-9468
* sample for rich:panelMenu fixed
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java 2010-12-06
19:04:32 UTC (rev 20420)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java 2010-12-06
19:13:42 UTC (rev 20421)
@@ -27,6 +27,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.richfaces.component.UIPanelMenu;
+import org.richfaces.event.ItemChangeEvent;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
@@ -78,4 +79,15 @@
public void setAttributes(Attributes attributes) {
this.attributes = attributes;
}
+
+ /**
+ * An item change listener that logs to the page old and new value.
+ *
+ * @param event
+ * an event representing the activation of a user interface component
+ */
+ public void itemChangeListener(ItemChangeEvent event) {
+ attributes.get("activeItem").setValue(event.getNewItem());
+ RichBean.logToPage("* item changed: " + event.getOldItem() + "
-> " + event.getNewItem());
+ }
}
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2010-12-06
19:04:32 UTC (rev 20420)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2010-12-06
19:13:42 UTC (rev 20421)
@@ -62,7 +62,7 @@
groupExpandIconRight="#{richPanelMenuBean.attributes['groupExpandIconRight'].value}"
groupMode="#{richPanelMenuBean.attributes['groupMode'].value}"
immediate="#{richPanelMenuBean.attributes['immediate'].value}"
-
itemChangeListener="#{richBean.itemChangeListener}"
+
itemChangeListener="#{richPanelMenuBean.itemChangeListener}"
itemClass="#{richPanelMenuBean.attributes['topItemClass'].value}"
itemDisableClass="#{richPanelMenuBean.attributes['topItemDisableClass'].value}"
itemDisableIconLeft="#{richPanelMenuBean.attributes['topItemDisableIconLeft'].value}"
@@ -99,69 +99,45 @@
topItemIconRight="#{richPanelMenuBean.attributes['topItemDisableIconRight'].value}"
width="#{richPanelMenuBean.attributes['width'].value}"
- <rich:panelMenuGroup id="group1"
label="Group 1">
- <rich:panelMenuItem id="item11" label="Item
1.1">
- <f:param name="current" value="Item 1.1"
/>
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item12" label="Item
1.2">
- <f:param name="current" value="Item 1.2"
/>
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item13" label="Item
1.3">
- <f:param name="current" value="Item 1.3"
/>
- </rich:panelMenuItem>
+
+ <rich:panelMenuGroup id="group1" name="group1"
label="Group 1">
+ <rich:panelMenuItem id="item11" name="item11"
label="Item 1.1"/>
+ <rich:panelMenuItem id="item12" name="item12"
label="Item 1.2"/>
+ <rich:panelMenuItem id="item13" name="item13"
label="Item 1.3"/>
</rich:panelMenuGroup>
- <rich:panelMenuGroup id="group2" label="Group
2">
- <rich:panelMenuItem id="item21" label="Item
2.1">
- <f:param name="current" value="Item 2.1"
/>
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item22" label="Item
2.2">
- <f:param name="current" value="Item 2.2"
/>
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item23" label="Item
2.3">
- <f:param name="current" value="Item 2.3"
/>
- </rich:panelMenuItem>
- <rich:panelMenuGroup id="group24" label="Group
2.4">
- <rich:panelMenuItem id="item241" label="Item
2.4.1">
- <f:param name="current" value="Item
2.4.1" />
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item242" label="Item
2.4.2">
- <f:param name="current" value="Item
2.4.2" />
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item243" label="Item
2.4.3">
- <f:param name="current" value="Item
2.4.3" />
- </rich:panelMenuItem>
+
+ <rich:panelMenuGroup id="group2" name="group2"
label="Group 2">
+ <rich:panelMenuItem id="item21" name="item21"
label="Item 2.1"/>
+ <rich:panelMenuItem id="item22" name="item22"
label="Item 2.2"/>
+ <rich:panelMenuItem id="item23" name="item23"
label="Item 2.3"/>
+
+ <rich:panelMenuGroup id="group24"
name="group24" label="Group 2.4">
+ <rich:panelMenuItem id="item241"
name="item241" label="Item 2.4.1"/>
+ <rich:panelMenuItem id="item242"
name="item242" label="Item 2.4.2"/>
+ <rich:panelMenuItem id="item243"
name="item243" label="Item 2.4.3"/>
</rich:panelMenuGroup>
- <rich:panelMenuItem id="item25" label="Item
2.5" disabled="true">
- <f:param name="current" value="Item 2.5"
/>
- </rich:panelMenuItem>
- <rich:panelMenuGroup id="group26" label="Group
2.6" disabled="true">
- <rich:panelMenuItem id="item261" label="Item
2.6.1">
- <f:param name="current" value="Item
2.6.1" />
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item262" label="Item
2.6.2">
- <f:param name="current" value="Item
2.6.2" />
- </rich:panelMenuItem>
+
+ <rich:panelMenuItem id="item25" name="item25"
disabled="true" label="Item 2.5"/>
+
+ <rich:panelMenuGroup id="group26"
name="group26" label="Group 2.6" disabled="true">
+ <rich:panelMenuItem id="item261"
name="item261" label="Item 2.6.1"/>
+ <rich:panelMenuItem id="item262"
name="item262" label="Item 2.6.2"/>
+ <rich:panelMenuItem id="item263"
name="item263" label="Item 2.6.3"/>
</rich:panelMenuGroup>
</rich:panelMenuGroup>
- <rich:panelMenuGroup id="group3" label="Group
3">
- <rich:panelMenuItem id="item31" label="Item
3.1">
- <f:param name="current" value="Item 3.1"
/>
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item32" label="Item
3.2">
- <f:param name="current" value="Item 3.2"
/>
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item33" label="Item
3.3">
- <f:param name="current" value="Item 3.3"
/>
- </rich:panelMenuItem>
+
+ <rich:panelMenuGroup id="group3" name="group3"
label="Group 3">
+ <rich:panelMenuItem id="item31" name="item31"
label="Item 3.1"/>
+ <rich:panelMenuItem id="item32" name="item32"
label="Item 3.2"/>
+ <rich:panelMenuItem id="item33" name="item33"
label="Item 3.3"/>
</rich:panelMenuGroup>
- <rich:panelMenuGroup id="group4" label="Group 4"
disabled="true">
- <rich:panelMenuItem id="item41" label="Item
4.1">
- <f:param name="current" value="Item 4.1"
/>
- </rich:panelMenuItem>
- <rich:panelMenuItem id="item42" label="Item
4.2">
- <f:param name="current" value="Item 4.2"
/>
- </rich:panelMenuItem>
+
+ <rich:panelMenuGroup id="group4" name="group4"
label="Group 4" disabled="true">
+ <rich:panelMenuItem id="item41" name="item41"
label="Item 4.1"/>
+ <rich:panelMenuItem id="item42" name="item42"
label="Item 4.2"/>
+ <rich:panelMenuItem id="item43" name="item43"
label="Item 4.3"/>
</rich:panelMenuGroup>
+
</rich:panelMenu>
<br/><br/>