Author: Alex.Kolonitsky
Date: 2010-12-14 03:57:11 -0500 (Tue, 14 Dec 2010)
New Revision: 20546
Modified:
trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
Log:
RF-9933 Accordion: attribute itemChangeListener ignored
Modified: trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
===================================================================
--- trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-12-14
06:28:45 UTC (rev 20545)
+++ trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-12-14
08:57:11 UTC (rev 20546)
@@ -2,6 +2,7 @@
import java.io.Serializable;
+import org.richfaces.event.ItemChangeEvent;
import org.richfaces.log.LogFactory;
import org.richfaces.log.Logger;
@@ -39,4 +40,8 @@
public void itemChangeActionListener() {
LOGGER.info("TogglePanelBean.itemChangeActionListener");
}
+
+ public void itemChangeActionListener(ItemChangeEvent event) {
+ LOGGER.info("TogglePanelBean.itemChangeActionListener(event)");
+ }
}
Modified: trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-12-14
06:28:45 UTC (rev 20545)
+++ trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-12-14
08:57:11 UTC (rev 20546)
@@ -16,7 +16,7 @@
<h:form id="f" style="border:blue solid thin;">
<h:panelGroup>
- <pn:accordion width="500px" height="300px">
+ <pn:accordion width="500px" height="300px"
itemChangeListener="#{togglePanelBean.itemChangeActionListener}">
<pn:accordionItem header="label 1">Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here.</pn:accordionItem>
<pn:accordionItem header="label 2">content
2</pn:accordionItem>
<pn:accordionItem header="label 3">content
3</pn:accordionItem>
Modified: trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-12-14
06:28:45 UTC (rev 20545)
+++ trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-12-14
08:57:11 UTC (rev 20546)
@@ -14,11 +14,11 @@
<ui:define name="body">
<h:form id="f">
- <pn:togglePanel id="my_id" lang="en"
activeItem="name1">
- <pn:togglePanelItem name="name1"
onenter="alert('enter 01')" onleave="alert('leave
01')">
+ <pn:togglePanel id="my_id" lang="en"
activeItem="name1"
itemChangeListener="#{togglePanelBean.itemChangeActionListener}">
+ <pn:togglePanelItem name="name1">
hello name1
</pn:togglePanelItem>
- <pn:togglePanelItem name="name2"
onenter="alert('enter 02')" onleave="alert('leave
02')">
+ <pn:togglePanelItem name="name2">
hello name2
</pn:togglePanelItem>
</pn:togglePanel>
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java 2010-12-14
06:28:45 UTC (rev 20545)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java 2010-12-14
08:57:11 UTC (rev 20546)
@@ -22,19 +22,11 @@
package org.richfaces.view.facelets.html;
-import org.richfaces.component.AbstractTogglePanel;
-
-import org.richfaces.event.MethodExpressionItemChangeListener;
import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.event.ItemChangeSource;
+import org.richfaces.event.MethodExpressionItemChangeListener;
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRule;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.*;
/**
* @author akolonitsky
@@ -60,7 +52,7 @@
@Override
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
- if (meta.isTargetInstanceOf(AbstractTogglePanel.class)) {
+ if (meta.isTargetInstanceOf(ItemChangeSource.class)) {
if ("itemChangeListener".equals(name)) {
return new ItemChangeExpressionMetadata(attribute);
}
@@ -81,8 +73,8 @@
@Override
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractTogglePanel) instance).addItemChangeListener(new
MethodExpressionItemChangeListener(
- this.attr.getMethodExpression(ctx, null, ITEM_CHANGE_SIG)));
+ ((ItemChangeSource) instance).addItemChangeListener(new
MethodExpressionItemChangeListener(
+ this.attr.getMethodExpression(ctx, null, ITEM_CHANGE_SIG)));
}
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-14 06:28:45 UTC
(rev 20545)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-14 08:57:11 UTC
(rev 20546)
@@ -873,35 +873,35 @@
</attribute>
</tag>
<tag>
- <description>
- Register a PanelToggleListener instance on the UIComponent
- associated with the closest parent UIComponent custom
- action.
+ <description>
+ Register a PanelToggleListener instance on the UIComponent
+ associated with the closest parent UIComponent custom
+ action.
</description>
<tag-name>panelToggleListener</tag-name>
<handler-class>org.richfaces.view.facelets.html.PanelToggleListenerHandler</handler-class>
<attribute>
- <description>
- Fully qualified Java class name of a
- PanelToggleListener to be created and registered.
+ <description>
+ Fully qualified Java class name of a
+ PanelToggleListener to be created and registered.
</description>
<name>type</name>
<type>java.lang.String</type>
</attribute>
<attribute>
- <description>
- Value binding expression that evaluates to an object that
- implements org.richfaces.event.PanelToggleListener.
+ <description>
+ Value binding expression that evaluates to an object that
+ implements org.richfaces.event.PanelToggleListener.
</description>
<name>binding</name>
<required>false</required>
<type>org.richfaces.event.PanelToggleListener</type>
</attribute>
<attribute>
- <description>
- <p class="changed_added_2_0">If present, this
attribute refers
- to the value of one of the exposed attached objects within the
- composite component inside of which this tag is
nested.</p>
+ <description>
+ <p class="changed_added_2_0">If present, this
attribute refers
+ to the value of one of the exposed attached objects within the
+ composite component inside of which this tag is
nested.</p>
</description>
<name>for</name>
<required>false</required>
@@ -1032,35 +1032,35 @@
</attribute>
</tag>
<tag>
- <description>
- Register a ItemChangeListener instance on the UIComponent
- associated with the closest parent UIComponent custom
- action.
+ <description>
+ Register a ItemChangeListener instance on the UIComponent
+ associated with the closest parent UIComponent custom
+ action.
</description>
<tag-name>itemChangeListener</tag-name>
<handler-class>org.richfaces.view.facelets.html.ItemChangeListenerHandler</handler-class>
<attribute>
- <description>
- Fully qualified Java class name of a
- ItemChangeListener to be created and registered.
+ <description>
+ Fully qualified Java class name of a
+ ItemChangeListener to be created and registered.
</description>
<name>type</name>
<type>java.lang.String</type>
</attribute>
<attribute>
- <description>
- Value binding expression that evaluates to an object that
- implements org.richfaces.event.ItemChangeListener.
+ <description>
+ Value binding expression that evaluates to an object that
+ implements org.richfaces.event.ItemChangeListener.
</description>
<name>binding</name>
<required>false</required>
<type>org.richfaces.event.ItemChangeListener</type>
</attribute>
<attribute>
- <description>
- <p class="changed_added_2_0">If present, this
attribute refers
- to the value of one of the exposed attached objects within the
- composite component inside of which this tag is
nested.</p>
+ <description>
+ <p class="changed_added_2_0">If present, this
attribute refers
+ to the value of one of the exposed attached objects within the
+ composite component inside of which this tag is
nested.</p>
</description>
<name>for</name>
<required>false</required>
@@ -1159,7 +1159,7 @@
<component>
<component-type>org.richfaces.Accordion</component-type>
<renderer-type>org.richfaces.Accordion</renderer-type>
- <handler-class/>
+
<handler-class>org.richfaces.view.facelets.html.TogglePanelTagHandler</handler-class>
</component>
<attribute>
<name>cycledSwitching</name>