I want to know how to get all the tabs in the JSF layer without going into the ontabChange method.
I have a system with dynamic tabs. Depending on the values users keyed in, different tabs will be rendered. After saving, the user needs to be directed to the "Account" tab, however with all the tab renderings, the index for "Account" may have changed.
If user do a tab change then it's fine, because I can get all the children for the tab and navigate to whichever index "Account" is.
But the problem is, how do I populate the tab and the children if the user did not call the ontabchange method, meaning that the user did not do any navigate to other tabs and straight away save the information.
<p:tabView id="tabView"
activeIndex="#{userBacking.tabInt}">
<p:ajax event="tabChange" immediate="true" update=":form:message"
listener="#{userBacking.onTabChange}" />
<p:tab id="tab1" title="Personal Information">
// Items for tab 1
</p:tab>
<p:tab id="tab2" rendered="#{userBacking.renderedTab2}
title="Education">
// Items for tab 2
</p:tab>
<p:tab id="tab3" rendered="#{userBacking.renderedTab3}"
title="Qualifications">
// Items for tab 3
</p:tab>
<p:tab id="tab4" rendered="#{userBacking.renderedTab4}"
title="Contact Information">
// Items for tab 4
</p:tab>
<p:tab id="tab5" title="Account">
// Items for tab 5
</p:tab>
</p:tabView>
Without the user calling the ontabchange, I want to get all the tabs available and navigate to the "Account" tab.