I have the following form
<h:form id="form">
<p:commandButton icon="ui-icon-clock" styleClass="element-button green hacia-izquierda" style="margin-right: 5em; margin-top: -1em;" value="Horario" update=":form:horario" oncomplete="PF('modalHorario').show();">
</p:commandButton>
<p:spacer width="20" height="1" />
<p:commandButton icon="ui-icon-folder-open" styleClass="element-button green hacia-derecha" style="margin-right: 95em; margin-top: -1em;" value="Historial" update="form2,form3">
<p:ajax listener="#{NivelesPersonaComponent.obtieneHistorialHorarios()}" update=":form3:fieldset" />
</p:commandButton>
<!--Modal que muestra el formulario para cambia el horario-->
<p:dialog header="Establecer Nuevo Horario" id="horario" widgetVar="modalHorario" modal="true" height="410" width="600px">
<h:outputLabel value="Horario" />
<p:spacer width="35" height="1" />
<p:selectOneMenu autoWidth="false" style="width:400px" value="#{NivelesPersonaComponent.nivelespersona.horarios.cveIdHorario}">
<f:selectItem itemLabel="Seleccione" />
<f:selectItems value="#{HorariosComponent.listHorarioss()}" var="horario" itemValue="#{horario.cveIdHorario}" itemLabel="#{horario.horarioEntrada} a #{horario.horarioSalida} Tolerancia #{horario.toleranciaRetardo} Falta #{horario.toleranciaFalta} ">
</f:selectItems>
</p:selectOneMenu>
<br></br>
<h:outputLabel value="Ubicación" />
<p:spacer width="20" height="1" />
<p:selectOneMenu autoWidth="false" style="width:400px" value="#{NivelesPersonaComponent.nivelespersona.unidadAdministrativa.cveIdUnidadAdmin}">
<f:selectItem itemLabel="Seleccione" />
<f:selectItems value="#{UnidadAdministrativaComponent.listUnidadAdministrativas()}" var="ubicacion" itemValue="#{ubicacion.cveIdUnidadAdmin}" itemLabel="#{ubicacion.cveIdUnidadAdmin} - #{ubicacion.desUnidadAdministrativa}">
</f:selectItems>
</p:selectOneMenu>
<br></br>
<br></br>
<h:outputLabel value="Fec.Inicio" />
<p:spacer width="20" height="1" />
<p:calendar id="popup" placeholder="Fecha Inicio" pattern="dd/MM/yyyy" locale="es" value="#{NivelesPersonaComponent.nivelespersona.fecInicioNivel}" />
<p:spacer width="20" height="1" />
<h:outputLabel value="Fec.Fin" />
<p:spacer width="25" height="1" />
<p:calendar id="popup3" placeholder="Fecha Fin" pattern="dd/MM/yyyy" locale="es" value="#{NivelesPersonaComponent.nivelespersona.fecFinNivel}" rendered="#{NivelesPersonaComponent.fechaValida(NivelesPersonaComponent.nivelespersona.fecFinNivel)}">
</p:calendar>
<p:calendar id="popup4" placeholder="Fecha Fin" pattern="dd/MM/yyyy" locale="es" value="#{NivelesPersonaComponent.fechaFinNivel2}" rendered="#{NivelesPersonaComponent.fechaValida(NivelesPersonaComponent.nivelespersona.fecFinNivel) eq false}">
</p:calendar>
<br></br>
<br></br>
<h:outputLabel value="Obs." />
<p:spacer width="50" height="1" />
<p:inputText placeholder="Observaciones" value="#{NivelesPersonaComponent.nivelespersona.observaciones}" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaLunes}" />
<p:spacer width="10" />
<h:outputLabel value="Lunes" />
<p:spacer width="10" height="1" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaMartes}" />
<p:spacer width="10" />
<h:outputLabel value="Martes" />
<p:spacer width="10" height="1" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaMiercoles}" />
<p:spacer width="10" />
<h:outputLabel value="Miercoles" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaJueves}" />
<p:spacer width="10" />
<h:outputLabel value="Jueves" />
<p:spacer width="10" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaViernes}" />
<p:spacer width="10" />
<h:outputLabel value="Viernes" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaSabado}" />
<p:spacer width="10" />
<h:outputLabel value="Sabado" />
<p:spacer width="10" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaDomingo}" />
<p:spacer width="10" />
<h:outputLabel value="Domingo" />
<p:spacer width="10" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaFestivo}" />
<p:spacer width="10" />
<h:outputLabel value="Festivo" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checa}" />
<p:spacer width="10" />
<h:outputLabel value="Debe registrar E/S en Biometrico" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.esComision}" />
<p:spacer width="10" />
<h:outputLabel value="Comisión" />
<br></br>
<br></br>
<p:selectBooleanCheckbox id="checkEspecial" value="#{NivelesPersonaComponent.aplicaHorarioEspecial}" />
<p:spacer width="10" />
<h:outputLabel value="Horario Especial" />
<p:tooltip id="toolTipFocus" for="checkEspecial" value="Horario para mamá" position="right" />
<br></br>
<br></br>
<p:commandButton icon="fa fa-times" value="Cancelar" styleClass="element-button red hacia-izquierda" style="margin-right: 5em; margin-top: 1em;" oncomplete="PF('modalHorario').hide();">
</p:commandButton>
<p:spacer width="20" height="1" />
<p:commandButton icon="fa fa-save" styleClass="element-button blue hacia-derecha" style="margin-right: 15em; margin-top: 1em;" value="Guardar" process="@form" action="#{NivelesPersonaComponent.saveNivelesPersona()}" oncomplete="PF('modalHorario').hide();"
update=":form2:horarios1">
</p:commandButton>
</p:dialog>
</h:form>
Which contains a p: dialog , and already filled all the fields and I give in the save button that is inside the modal, which must update a table but it does not do it until it refreshes the page
the table is this, which in a column has an edit action and open another modal, which contains almost the same as the previous one
<h:form id="form2">
<p:dataTable id="horarios1" var="consultaHorario" rendered="#{NivelesPersonaComponent.muestraHistorial}" style="max-width:2000px;max-height:770px;" value="#{NivelesPersonaComponent.listNivelesPersona2}">
<p:column headerText="Ubi" style="width: 20px;">
<h:outputText value="#{consultaHorario.unidadAdministrativa.cveIdUnidadAdmin}" />
</p:column>
<p:column headerText="Vigencia" style="width: 150px;">
<h:outputText value="#{consultaHorario.fecInicioNivel}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:outputText> -
<h:outputText value="#{consultaHorario.fecFinNivel}" rendered="#{NivelesPersonaComponent.fechaValida(consultaHorario.fecFinNivel)}">
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:outputText>
</p:column>
<p:column headerText="Horario" style="width: 70px;">
<h:outputText value="#{consultaHorario.horarios.horarioEntrada} - #{consultaHorario.horarios.horarioSalida}" />
</p:column>
<p:column headerText="Tol." style="width: 20px;">
<h:outputText value="#{consultaHorario.horarios.toleranciaRetardo}" />
</p:column>
<p:column headerText="Max. Falta" style="width: 20px;">
<h:outputText value="#{consultaHorario.horarios.toleranciaFalta}" />
</p:column>
<p:column headerText="Checa" style="width: 30px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checa eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checa eq false}" />
</p:column>
<p:column headerText="Lunes" style="width: 30px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaLunes eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaLunes eq false}" />
</p:column>
<p:column headerText="Martes" style="width: 30px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaMartes eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaMartes eq false}" />
</p:column>
<p:column headerText="Miércoles" style="width: 45px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaMiercoles eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaMiercoles eq false}" />
</p:column>
<p:column headerText="Jueves" style="width: 30px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaJueves eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaJueves eq false}" />
</p:column>
<p:column headerText="Viernes" style="width: 30px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaViernes eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaViernes eq false}" />
</p:column>
<p:column headerText="Sábado" style="width: 30px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaSabado eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaSabado eq false}" />
</p:column>
<p:column headerText="Domingo" style="width: 15x;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaDomingo eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaDomingo eq false}" />
</p:column>
<p:column headerText="Festivo" style="width: 30px;">
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-check" rendered="#{consultaHorario.checaFestivo eq true}" />
<h:outputText styleClass="ui-corner-all ui-icon ui-icon-close" rendered="#{consultaHorario.checaFestivo eq false}" />
</p:column>
<p:column headerText="Observaciones" style="width: 150px;">
<h:outputText value="#{consultaHorario.observaciones}" />
</p:column>
<p:column headerText="Acción" style="width: 30px;">
<p:commandButton icon="fa fa-edit" update=":form2:modalEditar" title="Editar" oncomplete="PF('modalEditar').show()" styleClass="element-button green" style="margin-right: 15em;">
<f:setPropertyActionListener value="#{consultaHorario}" target="#{NivelesPersonaComponent.nivelespersona}" />
</p:commandButton>
</p:column>
</p:dataTable>
<!--Modal para editar el horario-->
<p:dialog header="Editar Horario" id="modalEditar" widgetVar="modalEditar" modal="true" height="410" width="600px">
<h:outputLabel value="Horario" />
<p:spacer width="35" height="1" />
<p:selectOneMenu autoWidth="false" style="width:400px" value="#{NivelesPersonaComponent.nivelespersona.horarios.cveIdHorario}">
<f:selectItem itemLabel="Seleccione" />
<f:selectItems value="#{HorariosComponent.listHorarioss()}" var="horario" itemValue="#{horario.cveIdHorario}" itemLabel="#{horario.horarioEntrada} a #{horario.horarioSalida} Tolerancia #{horario.toleranciaRetardo} Falta #{horario.toleranciaFalta} ">
</f:selectItems>
</p:selectOneMenu>
<br></br>
<h:outputLabel value="Ubicación" />
<p:spacer width="20" height="1" />
<p:selectOneMenu autoWidth="false" style="width:400px" value="#{NivelesPersonaComponent.nivelespersona.unidadAdministrativa.cveIdUnidadAdmin}">
<f:selectItem itemLabel="Seleccione" />
<f:selectItems value="#{UnidadAdministrativaComponent.listUnidadAdministrativas()}" var="ubicacion" itemValue="#{ubicacion.cveIdUnidadAdmin}" itemLabel="#{ubicacion.cveIdUnidadAdmin} - #{ubicacion.desUnidadAdministrativa}">
</f:selectItems>
</p:selectOneMenu>
<br></br>
<br></br>
<h:outputLabel value="Fec.Inicio" />
<p:spacer width="20" height="1" />
<p:calendar id="popup" placeholder="Fecha Inicio" pattern="dd/MM/yyyy" locale="es" value="#{NivelesPersonaComponent.nivelespersona.fecInicioNivel}" />
<p:spacer width="20" height="1" />
<h:outputLabel value="Fec.Fin" />
<p:spacer width="25" height="1" />
<p:calendar id="popup1" placeholder="Fecha Fin" pattern="dd/MM/yyyy" locale="es" value="#{NivelesPersonaComponent.nivelespersona.fecFinNivel}" rendered="#{NivelesPersonaComponent.fechaValida(NivelesPersonaComponent.nivelespersona.fecFinNivel)}">
</p:calendar>
<p:calendar id="popup2" placeholder="Fecha Fin" pattern="dd/MM/yyyy" locale="es" value="#{NivelesPersonaComponent.fechaFinNivel1}" rendered="#{NivelesPersonaComponent.fechaValida(NivelesPersonaComponent.nivelespersona.fecFinNivel) eq false}">
</p:calendar>
<br></br>
<br></br>
<h:outputLabel value="Obs." />
<p:spacer width="50" height="1" />
<p:inputText placeholder="Observaciones" value="#{NivelesPersonaComponent.nivelespersona.observaciones}" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaLunes}" />
<p:spacer width="10" />
<h:outputLabel value="Lunes" />
<p:spacer width="10" height="1" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaMartes}" />
<p:spacer width="10" />
<h:outputLabel value="Martes" />
<p:spacer width="10" height="1" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaMiercoles}" />
<p:spacer width="10" />
<h:outputLabel value="Miercoles" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaJueves}" />
<p:spacer width="10" />
<h:outputLabel value="Jueves" />
<p:spacer width="10" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaViernes}" />
<p:spacer width="10" />
<h:outputLabel value="Viernes" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaSabado}" />
<p:spacer width="10" />
<h:outputLabel value="Sabado" />
<p:spacer width="10" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaDomingo}" />
<p:spacer width="10" />
<h:outputLabel value="Domingo" />
<p:spacer width="10" />
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checaFestivo}" />
<p:spacer width="10" />
<h:outputLabel value="Festivo" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.nivelespersona.checa}" />
<p:spacer width="10" />
<h:outputLabel value="Debe registrar E/S en Biometrico" />
<br></br>
<br></br>
<p:selectBooleanCheckbox value="#{NivelesPersonaComponent.esComision}" />
<p:spacer width="10" />
<h:outputLabel value="Comisión" />
<br></br>
<br></br>
<p:selectBooleanCheckbox id="checkEspecial" value="#{NivelesPersonaComponent.aplicaHorarioEspecial}" />
<p:spacer width="10" />
<h:outputLabel value="Horario Especial" />
<p:tooltip id="toolTipFocus" for="checkEspecial" value="Horario para mamá" position="right" />
<br></br>
<br></br>
<p:commandButton icon="fa fa-times" value="Cancelar" styleClass="element-button red hacia-izquierda" style="margin-right: 5em; margin-top: 1em;" oncomplete="PF('modalEditar').hide();">
</p:commandButton>
<p:spacer width="20" height="1" />
<p:commandButton icon="fa fa-save" styleClass="element-button blue hacia-derecha" style="margin-right: 15em; margin-top: 1em;" value="Guardar" process="@form" action="#{NivelesPersonaComponent.saveActualizarNivelesPersona()}" oncomplete="PF('modalEditar').hide();"
update=":form2:horarios1,:form:horario,:form4:fielset1">
</p:commandButton>
</p:dialog>
</h:form>
In that edit mode if I edit a record and I give it in save if the change in the table appears automatically, but it does not do it when I add things in the first modal until I reload the page