Author: Alex.Kolonitsky
Date: 2010-12-17 08:59:20 -0500 (Fri, 17 Dec 2010)
New Revision: 20645
Modified:
trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js
Log:
RF-9537 Tab: onenter and onleave don't work
Modified: trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml 2010-12-17 13:37:45
UTC (rev 20644)
+++ trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml 2010-12-17 13:59:20
UTC (rev 20645)
@@ -16,10 +16,10 @@
<h:form id="f">
<pn:tabPanel id="panel" switchType="ajax"
tabHeaderClassDisabled="myClass_01"
itemChangeListener="#{togglePanelBean.itemChangeActionListener}">
- <pn:tab header="tab1 header"
headerClassDisabled="myClass_02">
+ <pn:tab header="tab1 header"
headerClassDisabled="myClass_02" onenter="alert('onenter
01')">
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:tab>
- <pn:tab header="tab2 header">
+ <pn:tab header="tab2 header"
onenter="alert('onenter 02')">
He he
</pn:tab>
</pn:tabPanel>
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2010-12-17
13:37:45 UTC (rev 20644)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2010-12-17
13:59:20 UTC (rev 20645)
@@ -22,20 +22,20 @@
package org.richfaces.renderkit.html;
-import java.io.IOException;
-import java.util.Map;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractTogglePanelTitledItem;
+import org.richfaces.component.html.HtmlTab;
+import org.richfaces.renderkit.HtmlConstants;
-import static org.richfaces.renderkit.HtmlConstants.*;
-
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 java.io.IOException;
+import java.util.Map;
-import org.ajax4jsf.javascript.JSObject;
-import org.richfaces.component.AbstractTogglePanelTitledItem;
-import org.richfaces.renderkit.HtmlConstants;
+import static org.richfaces.renderkit.HtmlConstants.*;
/**
* @author akolonitsky
@@ -108,7 +108,9 @@
@Override
protected Map<String, Object> getScriptObjectOptions(FacesContext context,
UIComponent component) {
Map<String, Object> res = super.getScriptObjectOptions(context,
component);
- res.put("disabled", ((AbstractTogglePanelTitledItem)
component).isDisabled());
+ res.put("disabled", ((HtmlTab) component).isDisabled());
+ res.put("enter", ((HtmlTab) component).getOnenter());
+ res.put("leave", ((HtmlTab) component).getOnleave());
return res;
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-17 13:37:45
UTC (rev 20644)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-17 13:59:20
UTC (rev 20645)
@@ -2044,12 +2044,6 @@
<property-name>iconRightExpanded</property-name>
<property-class>java.lang.String</property-class>
</property>
- <property>
- <description></description>
- <property-name>changeExpandListener</property-name>
- <property-class>java.lang.String</property-class>
- </property>
-
</component>
<component>
<component-type>org.richfaces.PanelMenu</component-type>
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-17 13:37:45 UTC
(rev 20644)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-17 13:59:20 UTC
(rev 20645)
@@ -556,10 +556,6 @@
<type>java.lang.String</type>
</attribute>
<attribute>
- <name>changeExpandListener</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
<name>icon</name>
<type>java.lang.String</type>
</attribute>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js 2010-12-17
13:37:45 UTC (rev 20644)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js 2010-12-17
13:59:20 UTC (rev 20645)
@@ -91,6 +91,21 @@
return this.__fireEnter();
},
+ __fireLeave : function () {
+ return rf.Event.fireById(this.id + ":content", "leave");
+ },
+
+ __fireEnter : function () {
+ return rf.Event.fireById(this.id + ":content", "enter");
+ },
+
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ var userHandler = rf.Event.bindById(this.id + ":content", name,
handler);
+ }
+ },
+
getHeight : function (recalculate) {
if (recalculate || !this.__height) {
this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
Show replies by date