1
votes

I have a p:tabview with dynamic number of tab based on a list and the attribute "dynamic=true".

    <p:tabView id="customer-master-data-tab-view" value="#{data.customers}" var="customer" dynamic="true">

Each tab has some required input fields with a p:message for each of them. Now when I submit, the validation is only performed on the current active tab. If I change to "dynamic=false", everything works fine but this will affect the performance badly since we have a lot of data on this page.

Is there a way that I can have validation on every tab of the tabview with "dynamic=true"?

1

1 Answers

0
votes

The short answer is NO using the UI to validate using dynamic="true".

Let's say you have 4 Tabs with dynamic="true" only the first tab loaded through Ajax the other 3 tabs until they have been clicked on by the user have not been loaded into the JSF tree so there is NO way they can be validated. If you want to use this paradigm I suggest you have server side validation that checks for all the required fields on submit and throw an error from your backing bean letting the user know they have more tabs they have to fill out.