You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gr...@apache.org on 2006/11/09 23:52:22 UTC
svn commit: r473124 -
/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPane.java
Author: grantsmith
Date: Thu Nov 9 14:52:21 2006
New Revision: 473124
URL: http://svn.apache.org/viewvc?view=rev&rev=473124
Log:
TOMAHAWK-701: Revised patch
Modified:
myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPane.java
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPane.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPane.java?view=diff&rev=473124&r1=473123&r2=473124
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPane.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPane.java Thu Nov 9 14:52:21 2006
@@ -57,17 +57,72 @@
if (context == null) throw new NullPointerException("context");
decode(context);
-// int tabIdx = 0;
-// int selectedIndex = getSelectedIndex();
+ int tabIdx = 0;
+ int selectedIndex = getSelectedIndex();
Iterator it = getFacetsAndChildren();
while (it.hasNext())
{
UIComponent childOrFacet = getUIComponent((UIComponent) it.next());
- childOrFacet.processDecodes(context);
+ if (childOrFacet instanceof HtmlPanelTab) {
+ if (isClientSide() || selectedIndex == tabIdx) {
+ childOrFacet.processDecodes(context);
+ }
+ tabIdx++;
+ } else {
+ childOrFacet.processDecodes(context);
+ }
}
}
+
+ public void processValidators(FacesContext context)
+ {
+ if (context == null) throw new NullPointerException("context");
+ if (!isRendered()) return;
+
+ int tabIdx = 0;
+ int selectedIndex = getSelectedIndex();
+
+ Iterator it = getFacetsAndChildren();
+
+ while (it.hasNext())
+ {
+ UIComponent childOrFacet = getUIComponent((UIComponent) it.next());
+ if (childOrFacet instanceof HtmlPanelTab) {
+ if (isClientSide() || selectedIndex == tabIdx) {
+ childOrFacet.processValidators(context);
+ }
+ tabIdx++;
+ } else {
+ childOrFacet.processValidators(context);
+ }
+ }
+ }
+
+ public void processUpdates(FacesContext context)
+ {
+ if (context == null) throw new NullPointerException("context");
+ if (!isRendered()) return;
+
+ int tabIdx = 0;
+ int selectedIndex = getSelectedIndex();
+
+ Iterator it = getFacetsAndChildren();
+
+ while (it.hasNext())
+ {
+ UIComponent childOrFacet = getUIComponent((UIComponent) it.next());
+ if (childOrFacet instanceof HtmlPanelTab) {
+ if (isClientSide() || selectedIndex == tabIdx) {
+ childOrFacet.processUpdates(context);
+ }
+ tabIdx++;
+ } else {
+ childOrFacet.processUpdates(context);
+ }
+ }
+ }
private UIComponent getUIComponent(UIComponent uiComponent)
{