1 Reply Latest reply on May 28, 2013 10:40 AM by iabughosh

    Ajax Listener not work with rich:calendar !

    mohamed sassi Newbie

      Listener not invoked when the calendar value changed !

       

      <rich:calendar id="beginDate" required="true"

                                                                                                                                        validator="#{spareTimeControllerBean.validateTwoDatesAbcence }"

                                                                                                                                        datePattern="#{validatorBean.dateFormat}"

                                                                                                                                        value="#{spareTime.dateDebut}">

       

                                                                                                                                        <a4j:ajax event="change" execute="@this"

                                                                                                                                                  listener="#{spareTimeBean.onStartChangeStartDate}"

                                                                                                                                                  render="nbrJours" />

      </rich:calendar>

       

       

      My scope is "view" :

       

       


      public void onStartChangeStartDate(ActionEvent e) {


      UICalendar calendar = (UICalendar) ((UIComponentBase) e.getSource()).getParent();


      SimpleDateFormat fmt = new SimpleDateFormat(calendar.getDatePattern());


      try {



      dateDebut = fmt.parse(String.valueOf(calendar.getSubmittedValue()));


      } catch (ParseException e1) {



      // TODO Bloc catch auto-généré



      e1.printStackTrace();


      }


      loadNbrJour();

      }