This content has been marked as final.
Show 1 reply
-
1. Re: rich:tab with switchType ajax have reRender problem
jeffzzang Nov 30, 2007 10:06 AM (in response to thiagu.m)Have you tried binding the selectedTab attribute of tabPanel to see what the values are in the back-end? This is what I have and it works:
<a4j:form id="formid" > <rich:tabPanel switchType="ajax" selectedTab = "#{controller.selectedTab}" > <rich:tab label="Meetings" actionListener="#{controller.switchToMeetingsTab}" name="meetings" ajaxSingle="true"> <a4j:region id="tab_meetings_region"> <a4j:include id="tab_meetings_include" viewId="tab_meetings.jsp" /> </a4j:region> </rich:tab> <rich:tab label="Other" actionListener="#{controller.switchToOtherTab}" name="other" ajaxSingle="true"> <a4j:region id="tab_other_region"> <a4j:include id="tab_other_include" viewId="tab_other.jsp" /> </a4j:region> </rich:tab> </rich:tabPanel> </a4j:form>
In my controller, i have the following:public void switchToMeetingsTab(ActionEvent event){ //perform some cleanup logic if (cleanupPassed){ this.previousTab = this.selectedTab; } else{ this.selectedTab = this.previousTab } }
I keep the previousTab variable in the controller in case the user switches tabs when they shouldn't have (in which case, it brings them back to the previous tab). Hope this helps.