I have a dialog to change an equipment type when I select a row from a datatable. This first dialog opens without problem, I can change the equipment normally.
When I click "Save", I open another dialog just to confirm the changes. In this new dialog, the button with id "confirmarSim" should call a backing bean method. The problem is that method is never called, but the oncomplete methods are executed (the two dialogs are closed).
The code is as follows:
<p:dialog header="Editar IP Cadastrado" id="dialog" styleClass="borderless" widgetVar="dlgEditar" modal="true" showEffect="fade" hideEffect="fade" resizable="false" draggable="false" closable="false">
<p:growl id="growlInformacao" sticky="true" />
<p:panelGrid columns="2" rendered="#{not empty cadastrosIPsBean.selectedCadastro}" style="font-size: 14px">
<p:outputLabel value="Equipamento:"/>
<p:selectOneMenu id="selecionadorEquipamento" value="#{cadastrosIPsBean.selectedCadastro.equipamento}" style="width: 92%">
<f:selectItems value="#{cadastrosIPsBean.listaEquipamentosFormatada}"/>
</p:selectOneMenu>
<br/>
<br/>
<f:facet name="footer">
<p:commandButton value="Save" id="btConfirmar" oncomplete="PF('dlgConfirmar').show()" update=":form:tbl" style="width: 125px">
<p:dialog appendTo="@(body)" header="Confirmar alterações" id="confirmar" widgetVar="dlgConfirmar" modal="true" showEffect="fade" hideEffect="fade" resizable="false" draggable="false">
<br/>
<p:outputLabel value="Tem certeza de que deseja salvar as alterações?" style="font-size: 14px"/>
<br/>
<br/>
<f:facet name="footer">
<p:commandButton id="confirmarSim" value="Yes" process="tbl" oncomplete="PF('dlgConfirmar').hide(); PF('dlgEditar').hide()" actionListener="#{cadastrosIPsBean.salvarAlteracoes()}" update=":form:growlInformacao" style="font-size: 14px; width: 100px"/>
<p:spacer width="20"/>
<p:commandButton id="confirmarCancelar" value="Cancel" process="tbl" oncomplete="PF('dlgConfirmar').hide()" actionListener="#{cadastrosIPsBean.atualizaListasUltimosCadastros()}" update=":form:tbl" style="font-size: 14px; width: 100px"/>
</f:facet>
</p:dialog>
</p:commandButton>
<p:spacer width="20"/>
<p:commandButton value="Close" id="btFechar" oncomplete="PF('dlgDescartar').show()" action="#{cadastrosIPsBean.atualizaListasUltimosCadastros()}" update=":form:tbl" style="width: 125px">
<p:dialog appendTo="@(body)" header="Descartar alterações" id="descartar" widgetVar="dlgDescartar" modal="true" showEffect="fade" hideEffect="fade" resizable="false" draggable="false">
<br/>
<p:outputLabel value="Tem certeza de que deseja descartar as alterações?" style="font-size: 14px"/>
<br/>
<br/>
<f:facet name="footer">
<p:commandButton id="fecharSim" value="Sim" process="tbl" oncomplete="PF('dlgDescartar').hide(); PF('dlgEditar').hide()" action="#{cadastrosIPsBean.atualizaListasUltimosCadastros()}" update=":form:tbl" style="font-size: 14px; width: 100px"/>
<p:spacer width="20"/>
<p:commandButton id="fecharCancelar" value="Cancelar" process="tbl" oncomplete="PF('dlgDescartar').hide()" action="#{cadastrosIPsBean.atualizaListasUltimosCadastros()}" update=":form:tbl" style="font-size: 14px; width: 100px"/>
</f:facet>
</p:dialog>
</p:commandButton>
</f:facet>
</p:panelGrid>
</p:dialog>
The rest of the code works well, it's just that button with id="confirmarSim" that does not call the backing bean method "#{cadastrosIPsBean.salvarAlteracoes()}".
Why this method is not called?