I have home tab and Validation tab. I like to validate user input and switch back to home tab if the user input is valid, otherwise stay on validation tab. At this point, it is switching back to home tab even for invalid user input after I click on submit button.
index.xhtml
<p:tabView>
<p:tab title="Home" titleStyleClass="repo">
<h:panelGrid columns="2" cellpadding="10">
<h:form>
/****home table code here***/
</h:form>
</h:panelGrid>
</p:tab>
<p:tab title="Validation">
<h:form>
<h:panelGrid id="grid" columns="4" cellpadding="5">
<h:outputLabel for="number" value="number:" />
<p:inputText id="number" value="#{validationView.number}"
label="Number">
<f:validateDoubleRange minimum="100" maximum="200" />
</p:inputText>
</h:panelGrid>
<p:commandButton value="Submit"
actionListener="#{controller.saveA}" ajax="false"
icon="ui-icon-check" validateClient="true" style="float-right" />
</h:form>
</p:tab>
</p:tabView>
I am sure, I am missing something here, I don't know how to get back the validation result on a particular tab in primefaces and set tab switching based on that.
*I am using primefaces 5.1