You could create a list of Enabled Tabs, on click continue u add the tabindex to list and in frontend you can check it by tabs disabled attribute:
Backend:
Code:
/**
* TODO Florian Hell insert type comment
*
* @author Florian Hell
* @version $Rev$, $Date$
*
*/
@Name("anamnesisAction")
@Scope(ScopeType.CONVERSATION)
@Stateful
public class TabAction implements ITabAction {
@Logger
private Log log;
/** Current selected Tab */
@Out
private Integer currentTab;
/** {@link ArrayList} with currently enabled tabs */
private List<Integer> tabsEnabled;
/** {@inheritDoc} */
public void tabChanged(TabChangeEvent tabChangeEvent) {
currentTab = tabChangeEvent.getNewTabIndex();
log.info("Current Tab: {0}", currentTab);
}
/** {@inheritDoc} */
public void previousPage(){
currentTab = currentTab -1;
log.info("Current Tab: {0}", currentTab);
}
/** {@inheritDoc} */
public void nextPage(){
tabsEnabled.add(currentTab +1);
currentTab = currentTab +1;
log.info("Current Tab: {0}", currentTab);
}
/** {@inheritDoc} */
public boolean tabEnabled(Integer tabId) {
if(tabsEnabled.contains(tabId)) {
return true;
}
return false;
}
/** {@inheritDoc} */
@Remove @Destroy
public void destroy() {
}
}
And frontend:
Code:
<ice:form id="tabForm">
<ice:panelTabSet id="tabset" selectedIndex="#{currentTab}" >
<ice:panelTab disabled="#{!tabAction.tabEnabled(0)}" label="Tab 1">
</ice:panelTab>
<ice:panelTab disabled="#{!tabAction.tabEnabled(1)}" label="Tab 2">
<ui:include src="anamnesisDiseases.xhtml" />
</ice:panelTab>
<ice:panelTab disabled="#{!tabAction.tabEnabled(2)}" label="Tab 3">
<ui:include src="anamnesisMedicines.xhtml" />
</ice:panelTab>
</ice:panelTabSet>
<ice:commandButton value="#{messages.btnPrev}" rendered="#{currentTab != 0}" action="#{tabAction.previousPage}" />
<ice:commandButton value="#{messages.btnNext}" action="#{tabAction.nextPage}" />
</ice:form>
My example uses seam, so may u have to do it without outjections.
Hope this helps you.
Greetz
Florian Hell