Author: nbelaevski
Date: 2007-11-01 14:28:32 -0400 (Thu, 01 Nov 2007)
New Revision: 3692
Modified:
branches/3.1.x/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
branches/3.1.x/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/scripts/tabPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-1256
Modified:
branches/3.1.x/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
===================================================================
---
branches/3.1.x/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2007-11-01
18:28:10 UTC (rev 3691)
+++
branches/3.1.x/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2007-11-01
18:28:32 UTC (rev 3692)
@@ -111,10 +111,10 @@
if (!disabled) {
if (clientSide) {
- writer.writeAttribute(HTML.onclick_ATTRIBUTE, "if
(RichFaces.onTabChange('"+pane.getClientId(context)+"','"+clientId+"'))
RichFaces.switchTab('" + pane.getClientId(context) + "','" +
clientId + "','" + getUtils().formatValue(context, pane, tab.getName())
+ "');", "switchScript");
+ writer.writeAttribute(HTML.onclick_ATTRIBUTE, "if
(RichFaces.onTabChange(event,
'"+pane.getClientId(context)+"','"+clientId+"'))
RichFaces.switchTab('" + pane.getClientId(context) + "','" +
clientId + "','" + getUtils().formatValue(context, pane, tab.getName())
+ "');", "switchScript");
} else {
String activeCheck = "if (RichFaces.isTabActive('" +
clientId + LABEL_SUFFIX + "')) return false;";
- String eventCheck = " if
(!RichFaces.onTabChange('"+pane.getClientId(context)+"','"+clientId+"'))
return false;";
+ String eventCheck = " if (!RichFaces.onTabChange(event,
'"+pane.getClientId(context)+"','"+clientId+"'))
return false;";
if (ajax) {
JSFunction function = AjaxRendererUtils.buildAjaxFunction(tab,
Modified:
branches/3.1.x/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/scripts/tabPanel.js
===================================================================
---
branches/3.1.x/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/scripts/tabPanel.js 2007-11-01
18:28:10 UTC (rev 3691)
+++
branches/3.1.x/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/scripts/tabPanel.js 2007-11-01
18:28:32 UTC (rev 3692)
@@ -146,7 +146,7 @@
return (tab.className.indexOf('dr-tbpnl-tb-act') < 0);
}
-RichFaces.onTabChange = function(pane,tab) {
+RichFaces.onTabChange = function(event, pane,tab) {
var labelSuffix = "_lbl";
var tabs = RichFaces.panelTabs[pane];
var lastActive, newActive;
@@ -162,13 +162,13 @@
}
if (lastActive && newActive) {
if (lastActive.ontableave && lastActive.ontableave != "") {
- var func = new
Function("leftTabName","enteredTabName",lastActive.ontableave);
- var result = func(lastActive.name,newActive.name);
+ var func = new Function("event",
"leftTabName","enteredTabName",lastActive.ontableave);
+ var result = func(event, lastActive.name,newActive.name);
if (typeof(result) == 'boolean' && !result) return false;
}
if (newActive.ontabenter && newActive.ontabenter != "") {
- var func = new
Function("leftTabName","enteredTabName",newActive.ontabenter);
- var result = func(lastActive.name,newActive.name);
+ var func = new Function("event",
"leftTabName","enteredTabName",newActive.ontabenter);
+ var result = func(event, lastActive.name,newActive.name);
if (typeof(result) == 'boolean' && !result) return false;
}
}