There is a save button on the first two tab pages, as performing a save on either tab means saving the one, in fact, they both call the same actionListener method.
If there is field validation errors, they are shown on the current tab page as expected. Not entering any data on either tab or 1 or 2 should (and does) generate errors for both tabs. I know this because once errors appear on the active tab and I then click the other, the initial appearance of the tab shows the expected errors - for a second. Then the tab appears to be being repainted without any errors.
What is causing this and more to the point, how do I prevent it?
As example, here is a portion of the file with the tab view. The tab pages themselves are include files, each with its own h:form.
Code: Select all
<p:tabView id="infoRequestEditTabPanel" dynamic="false"
cache="false"
activeIndex="#{infoRequestEdit.selectedTab}" width="100%"
switchType="ajax">
<p:ajax event="tabChange"
listener="#{infoRequestEdit.onTabChange}"
update="infoRequestEditOutputPanel" />
<p:tab id="tabPageGeneral" name="tabPageGeneral"
title="#{messages.getString('infoRequestEdit.label.tab.general.title')}"
action="#{infoRequestEdit.switchTabToGeneral}"
disabled="#{infoRequestEdit.tabGeneralLocked}"
update="infoRequestEditTabMethodsPanel">
<ui:include
src="/protected/info/request/infoRequestEditTabGeneral.xhtml" />
</p:tab>
Code: Select all
public void onTabChange(TabChangeEvent event){
Tab activeTab = event.getTab();
if ( TAB_GENERAL.equals(activeTab.getId()) ) {
switchTabToGeneral();
return;
}
if ( TAB_AGENCY.equals(activeTab.getId()) ) {
switchTabToAgency();
return;
}