Author: Alex.Kolonitsky
Date: 2010-12-13 07:41:53 -0500 (Mon, 13 Dec 2010)
New Revision: 20525
Modified:
trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
Log:
RF-9895 Toggle panel item: attributes onenter and onleave ignored
Modified: trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-12-13
12:22:53 UTC (rev 20524)
+++ trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-12-13
12:41:53 UTC (rev 20525)
@@ -15,10 +15,10 @@
<ui:define name="body">
<h:form id="f">
<pn:togglePanel id="my_id" lang="en"
activeItem="name1">
- <pn:togglePanelItem name="name1">
+ <pn:togglePanelItem name="name1"
onenter="alert('enter 01')" onleave="alert('leave
01')">
hello name1
</pn:togglePanelItem>
- <pn:togglePanelItem name="name2">
+ <pn:togglePanelItem name="name2"
onenter="alert('enter 02')" onleave="alert('leave
02')">
hello name2
</pn:togglePanelItem>
</pn:togglePanel>
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js 2010-12-13
12:22:53 UTC (rev 20524)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js 2010-12-13
12:41:53 UTC (rev 20525)
@@ -39,6 +39,9 @@
this.togglePanelId = this.options.togglePanelId;
this.switchMode = this.options.switchMode;
this.disabled = this.options.disabled || false;
+
+ this.__addUserEventHandler("enter");
+ this.__addUserEventHandler("leave");
},
/***************************** Public Methods
*****************************************************************/
@@ -77,6 +80,16 @@
/**
* @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.togglePanelId, name, handler);
+ }
+ },
+
+ /**
+ * @private
*
* used in TogglePanel
* */
@@ -102,11 +115,11 @@
},
__fireLeave : function () {
- return rf.Event.fireById(this.id, "__leave");
+ return rf.Event.fireById(this.id, "leave");
},
__fireEnter : function () {
- return rf.Event.fireById(this.id, "__enter");
+ return rf.Event.fireById(this.id, "enter");
},
// class stuff