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"
       actionListener="#{logic.deleteJob(job)}" 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>
This question is marked "community wiki".

asked 01.06.2017 at 03:27

hibanassar's gravatar image

hibanassar
(suspended)
accept rate: 0%

edited 01.06.2017 at 05:28

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×79
×51

Asked: 01.06.2017 at 03:27

Seen: 2,107 times

Last updated: 01.06.2017 at 05:28