2 Replies Latest reply on Apr 6, 2011 9:17 AM by spiritfox26

    Problem to update rich calendar value

    spiritfox26

      I have a rich:calendar(id="fechaInicio) and h:selectOneMenu (id="helpDeskTicket), when the value of h:selectOneMenu is changed, the value in the calendar should be change, because into valueChangeListener of h:selectOneMenu the date changed, but this doesn't happen.

      <a4j:outputPanel id="panelHeaderAjax" > 
           <h:panelGrid styleClass="header2Fecha" columns="6">
                  <rich:calendar id="fechaInicio" value="#{incidenteEditBean.fechaInicio}" rendered="#{securityBean.modificarFechaIncidentesServiceRequest                      and incidenteEditBean.isNew}" style="color: #000000;" showApplyButton="true" datePattern="dd/MM/yyyy HH:mm" zindex="21">
                      <a4j:support event="onchanged" action="#{incidenteEditBean.changeCalendarValue}" reRender="estadoIncidente, panelHeaderAjax,                     errorsPanel" limitToList="true"/>
                   </rich:calendar>
      
                  <h:panelGrid id="panelSD" columns="2" rendered="#{incidenteEditBean.mostrarPanelHelpdesk}">
                       <h:outputLabel id="helpDeskLabel" value="#{msg.helpDeskLabel}"/>
                       <h:selectOneMenu id="helpDeskTicket" styleClass="comboBoxField" value="#{incidenteEditBean.strIdHelpdeskTicket}"
                              valueChangeListener="#{incidenteEditBean.processValueChangeHelpDeskTicket}">
                              <f:selectItems id="listaHelpDeskTicket" value="#{incidenteEditBean.helpdesksClienteList}" />
                              <a4j:support event="onchange" reRender="panelHeaderAjax"  limitToList="true"/>
                       </h:selectOneMenu>
                   </h:panelGrid>
            </h:panelGrid>
      </a4j:outputPanel>
      
      

       

      The bean:

       

       

      public void processValueChangeHelpDeskTicket(ValueChangeEvent e) throws AbortProcessingException {
           this.strIdHelpdeskTicket = (String)e.getNewValue();
           EntityManager em = PersistenceManager.getInstance().getEntityManagerFactory().createEntityManager();
      
           HelpdeskServiceBean hdSB = new HelpdeskServiceBean(em);
           Helpdesk helpdesk = hdSB.findByIdLazy(Integer.parseInt(strIdHelpdeskTicket));
      
           this.setFechaInicio(helpdesk.newDate());
           System.out.println(this.getFechaInicio()); //When print here the value is correct, but in the screen not
      }
      
      

       

       

       

      Thanks in advanced!