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: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:commandButton  immediate="true"
       actionListener="#{logic.deleteJob(job)}" update="#{cc.id}:form"  
       icon="fa fa-trash-o"></p:commandButton>     

     <p:commandButton validateClient="true"   
      value="Add"  actionListener="#{logic.addPJob}" update="form" >

     <p:commandButton validateClient="true"
      value="Next" actionListener="#{logic.send}" update="form" process="form" />
This question is marked "community wiki".

asked 01.06.2017 at 03:27

hibanassar's gravatar image

accept rate: 0%

edited 01.06.2017 at 05:28

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦

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



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



Asked: 01.06.2017 at 03:27

Seen: 2,099 times

Last updated: 01.06.2017 at 05:28