title: Why the button to Save in Primefaces doesn't work
body: <p>I have a form in Primefaces and inside this form I have a datatable and a dialog and I also have a button that save the information in datatabase.
  When I click on the button not happens but If I remove the datatable and the dialog I can save the information in database but.
  Can anyone help?</p>
  
  <pre><code>&lt;h:form id="form"&gt;
          &lt;h:panelGrid id="grid" cellpadding="8" columns="2" style="margin-bottom:10px"&gt;
             &lt;p:outputLabel for="oid" value="OID:" /&gt;
             &lt;p:inputText id="oid" value="#{lancamentoController.lancamento.id}" /&gt;
  
             &lt;p:outputLabel for="dataInicial" value="Data: " /&gt;
             &lt;p:calendar id="dataInicial" value="#{lancamentoController.lancamento.dataInicial}" pattern="dd/MM/yyyy"/&gt;
             &lt;p:outputLabel for="dataFinal" value="Data: " /&gt;
             &lt;p:calendar id="dataFinal" value="#{lancamentoController.lancamento.dataFinal}" pattern="dd/MM/yyyy"/&gt;
  
             &lt;p:commandButton ajax="true" update=":form:itemProdutoDialog" oncomplete="PF('itemDialog').show()" icon="ui-icon-plus" title="View"/&gt;
             &lt;p:dataTable id="itens" value="#{lancamentoController.lancamento.itens}" var="item"&gt;
                  &lt;p:column headerText="Descrição"&gt;
                      &lt;h:outputText value="#{item.item.descricao}"/&gt;
                  &lt;/p:column&gt;
                  &lt;p:column headerText="Valor"&gt;
                      &lt;h:outputText value="#{item.item.valor}"/&gt;
                  &lt;/p:column&gt;
                  &lt;p:column headerText="Ações"&gt;          
                    &lt;p:commandButton actionListener="#{lancamentoController.removerItem(item)}" icon="ui-icon-trash" update="itens @form"/&gt;  
                  &lt;/p:column&gt;
             &lt;/p:dataTable&gt;
             &lt;p:dialog id="dialog" header="Itens" widgetVar="itemDialog" modal="true" showEffect="explode" hideEffect="explode" resizable="false"&gt;
                  &lt;p:outputPanel id="itemProdutoDialog"&gt;
                      &lt;p:panelGrid columns="8"&gt;
                          &lt;p:outputLabel for="produtoItem" value="Produto"/&gt;
                          &lt;p:selectOneMenu id="produtoItem" value="#{lancamentoController.item}" filter="true" filterMatchMode="startsWith"&gt;
                              &lt;f:selectItem itemValue="" itemLabel="Lista Produto"/&gt; 
                              &lt;f:selectItems value="#{itemController.itens}" var="item"
                                             itemValue="#{item}" itemLabel="#{item.descricao}" /&gt; 
                              &lt;p:message for="item"/&gt;
                          &lt;/p:selectOneMenu&gt;                           
                          &lt;p:outputLabel for="valorTotalProduto" value="Valor Total"/&gt;
                          &lt;p:inputNumber id='valorTotalProduto' value="#{lancamentoController.item.valor}" symbolPosition="s" emptyValue="" minValue="0.00" required="true" requiredMessage="O campo Valor Total é obrigatório"/&gt;
                          &lt;p:commandButton value="Add" actionListener="#{lancamentoController.addItem()}" update="@form"/&gt;
                      &lt;/p:panelGrid&gt;
                  &lt;/p:outputPanel&gt;
               &lt;/p:dialog&gt;
               &lt;p:outputLabel for="observacao" value="Observação"/&gt;           
               &lt;p:inputTextarea id="observacao" rows="10" cols="50" completeMethod="#{lancamentoController.lancamento.observacao}" queryDelay="750" minQueryLength="4" /&gt;
               &lt;p:outputLabel for="valorTotal" value="Valor Total"/&gt;
               &lt;p:inputNumber id='valorTotal' value="#{lancamentoController.lancamento.valorTotal}" symbolPosition="s" emptyValue="" minValue="0.00"/&gt;              
           &lt;/h:panelGrid&gt;
           &lt;p:commandButton value="Salvar" action="#{lancamentoController.salvar(lancamentoController.lancamento)}" icon="ui-icon-disk" update="@all"/&gt;
        &lt;/h:form&gt; 
  </code></pre>
  
  <p>Java code</p>
  
  <pre><code>public void salvar(Lancamento lancamento) {
  
      System.out.println("SALVAR");
      getDAO().salvar(lancamento);
  }
  </code></pre>