我在 ap:dialog 一中有 ap:calendar 组件。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. 下一个代码有什么问题?
<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()+" +++++++++++++++++++++++++++++++++++++++++");}