rich:tabPanel selectedTab problem
ylazzari Sep 24, 2007 2:56 PMHi,
I have a weird problem with the selectedTab attribute of the rich:tabPanel component. When I specify it, all the a4j actions (a4j:commandLink or a4j:commandButton) located in any of the tabs of my tabPanel do not work anymore. I debugged and I see on the server side that all the forms within each tab of my tabPanel aren't even decoded in the decode phase of the JSF request. If I simply remove the selectedTab attribute, everything works fine. Did anyone ever run into this particular problem? Here's what my template looks like:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:h="http://java.sun.com/jsf/html"
template="../templates/default.xhtml">
<ui:define name="body">
<rich:tabPanel id="myTabPanel" switchType="ajax" selectedTab="#{someBean.selectedTab}">
<rich:tab name="tab1" label="Tab 1" action="#{someBean.prepTab1}">
<ui:include src="tab1.xhtml"/>
</rich:tab>
<rich:tab name="tab2" label="Tab 2" action="#{someBean.prepTab2}">
<ui:include src="tab2.xhtml"/>
</rich:tab>
<rich:tab name="tab3" label="Tab 3" action="#{someBean.prepTab3}">
<ui:include src="tab3.xhtml"/>
</rich:tab>
</rich:tabPanel>
</ui:define>
</ui:composition>
Basically, I have a tab set, each tab's body is in its own sub-template file, each sub-template includes one or many forms. When I click on a tab, an action of a backing bean is called. Sometimes, I want an action from one tab to redirect to another tab. When that is the case, I programmatically change the value of the "someBean.selectedTab" attribute and make sure that the whole tabPanel is reRendered. The proper tab is displayed but then none of the actions work anymore. I double-checked and I don't have any overlapping forms (form embedded inside another form). Like I said, I clearly see that forms located inside the sub-templates don't get decoded anymore when I do a postback to the server and I couldn't figure out why.
Thank you for your help.