Author: Alex.Kolonitsky
Date: 2009-11-24 05:37:57 -0500 (Tue, 24 Nov 2009)
New Revision: 15984
Modified:
branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-8154
tabPanel: can't be switched if clicked tab defined with bypassUpdates or ajaxSingle.
Modified:
branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java
===================================================================
---
branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java 2009-11-24
00:27:13 UTC (rev 15983)
+++
branches/community/3.3.X/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java 2009-11-24
10:37:57 UTC (rev 15984)
@@ -21,16 +21,21 @@
package org.richfaces.renderkit;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererBase;
import org.richfaces.component.TabEncoder;
import org.richfaces.component.UISwitchablePanel;
import org.richfaces.component.UITab;
+import org.richfaces.component.UITabPanel;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
/**
@@ -56,7 +61,34 @@
return tabHeaderRenderer;
}
-
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+
+ UITab tab = (UITab) component;
+ UITabPanel panel = tab.getPane();
+
+
+ if (AjaxRendererUtils.isAjaxRequest(context)
+ && panel.getSwitchType().equals(UISwitchablePanel.AJAX_METHOD))
{
+
+ // add toggle panel itself to rendered list of components
+ AjaxRendererUtils.addRegionByName(context, panel, panel.getId());
+ AjaxRendererUtils.addRegionsFromComponent(tab, context);
+
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ Set<String> toProcess = ajaxContext.getAjaxAreasToProcess();
+ if (toProcess == null) {
+ toProcess = new HashSet<String>(1);
+ ajaxContext.setAjaxAreasToProcess(toProcess);
+ }
+ toProcess.add(panel.getClientId(context));
+
+ ajaxContext.addAreasToProcessFromComponent(context, tab);
+ }
+ }
+
public TabRendererBase() {
super();
}