Method in p:commandButton is not called

Asked

Viewed 106 times

1

In my view you have p:commandButton with a method that adds an item to a p:datatable. By clicking the button to call the method to add the first item, it is correctly added to the datatable, but by clicking the button to add another item, the method is simply no longer called. In addition, the p:ajax you have in the view also stop working and no error appears on the console. The curious thing is that sometimes I test works and sometimes not.

View

View Code in Paste Bin

Add Method in Controller

public void adicionar() {              
   if(diasSemanaSelecionados != null) {
       responsabilidadeTecnica.setDiasSemana(Arrays.asList(diasSemanaSelecionados));
   }

   responsabilidadeTecnica.setHorarioTrabalho(s);      
   responsabilidadeTecnica.setFimContrato(null);
   responsabilidadesTecnicas.add(responsabilidadeTecnica);

   renderizaAdicionarResponsavelTecnico = false;
 }
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.