I have got a p:calendar component inside a p:dialog one. When dialog is shown it takes its value from property in back bean, but when a new date is selected, the SelectEvent arrived to the listener brings the old value and not the new selected date. What is wrong on next code?
<p:dialog id="eventDialog" widgetVar="eventDialog" header="#{textos.confirmarFechaHora}" showEffect="clip"
hideEffect="clip" modal="true"
appendToBody="true"> <!-- A false, no entran los eventos tras modificar la fecha/hora del calendario -->
<h:panelGrid id="eventDetails" columns="2">
<h:outputLabel for="calHora" value="#{textos.horaComienzo}" />
<p:calendar id="calHora" locale="es" pattern="dd/MM/yyyy HH:mm"
value="#{schedulePFController.fechaComienzo}" mode="inline"
required="true"
accesskey="true" valueChangeListener="#{schedulePFController.cambiaHoraComienzoVCL}">
<p:ajax event="dateSelect" listener="#{schedulePFController.cambiaHoraComienzo}"/>
</p:calendar>
<p:commandButton value="#{textos.cancelar}" oncomplete="eventDialog.hide();"/>
<p:commandButton value="#{textos.mostrarCitas}"
action="#{schedulePFController.verEntradaCalendario}"
rendered="#{schedulePFController.clickedOnCita}"/>
<p:commandButton value="#{textos.addCita}"
action="#{schedulePFController.addCita}"
rendered="#{!schedulePFController.clickedOnCita}"/>
</h:panelGrid>
public void cambiaHoraComienzo(SelectEvent ev) {
Date date = (Date)ev.getObject();
fechaComienzo = date;
horaComienzo = new DateCita(date);
logger.debug("Cambiando fechaComienzo "+horaComienzo.toString()+" +++++++++++++++++++++++++++++++++++++++++");}
SchedulePFController
attributefechaComienzo
with any default value? – FreakvalueChangeListener="#{schedulePFController.cambiaHoraComienzoVCL}"
here you are calling another method and you are looking value incambiaHoraComienzo
method? What are you doing man? – FreakvalueChangeListener="#{schedulePFController.cambiaHoraComienzoVCL}"
from yourp:calender
and then check.listenerlistener="#{schedulePFController.cambiaHoraComienzo}"
that you are using inp:ajax
tag is enough – Freak