delete current tab and keep the other unsubmited tab data in the form
I have accordion panel inside a form with tow button one for add tabs ,another for next.
each tab have inputtexts and delete button to delete this tab.
some of tab fields are required ,and I can not add a new tab if the required not filled but I can delete any tab .
the problem : if I have aleady tabs and add a new one with some inputs filled then I want to delete previous tab ,the delete button will update the whole page and remove the last added tab data from the form without processing them.
so how can I delete previous tab without validation the current tab and keep the data in current tab.
<h:form id="form">
<p:accordionPanel var="job" value="#{data.JobSet.toArray()}">
<p:tab title="title">
<p:outputPanel>
<p:panelGrid>
<p:outputLabel for="Company" value="Company"></p:outputLabel>
<p:inputText id="Company" required="true"
styleClass="inputFullWidth" value="#{job.name}"></p:inputText>
<p:outputLabel value="Industry"></p:outputLabel>
<p:inputText value="#{job.industry}"></p:inputText>
</p:panelGrid>
</p:outputPanel>
<p:commandButton immediate="true" value="Delete" immediate="true"
value="Delete"
actionListener="#{logic.deleteJob(job)}" update="#{cc.id}:form"></p:commandButton> update="#{cc.id}:form"
icon="fa fa-trash-o"></p:commandButton>
</p:tab>
</p:accordionPanel>
<div>
<p:commandButton validateClient="true"
value="Add" actionListener="#{logic.addPJob}" update="form" >
</p:commandButton>
<p:commandButton validateClient="true"
value="Next" actionListener="#{logic.send}" update="form" process="form" />
</div>
</h:form>