5 Replies Latest reply on Feb 2, 2012 10:19 AM by aymen aymen

    rich:calendar firing onchange event

    aymen aymen Newbie

      hi,

      i have two rich:calendar .on the second one i have validator.the validator is working well.

      i want that if Date changed onrich:calendar1 i invoque the change event of the second rich:calendar so i invoque the validator.

      i have no idea how it must be done. i have tryed with javascript but it's not working.

      any help will be appreciated

       

      the first rich:calendar:

      <rich:calendar id="calendarDeb" name="calendarDeb" popup="true"

                                  showApplyButton="true" cellWidth="24px" cellHeight="22px"

                                  style="width:200px" value="#{vehiculeFilterBean.dateDebut}"

                                  required="true" requiredMessage="le champ date  debut est obligatoir"

                                  converterMessage="le champ date debut doit etre de la forme dd/mm/yyyy"

                                  binding="#{calendarDeb}"

                                  datePattern="dd/MM/yyyy"

                                  >

                                  <a4j:ajax  event="change"   oncomplete="window.alert('i work');#{rich:component('evnt')}.change();">

                                  </a4j:ajax>

                              <f:convertDateTime type="date" pattern="dd/mm/yyyy" />

                              </rich:calendar >

       

      and the second rich:calandar:

       

      <rich:calendar id="calendarFin" name="calendarFin" popup="true"

                                  showApplyButton="true" cellWidth="24px" cellHeight="22px"

                                  style="width:200px" value="#{vehiculeFilterBean.dateFin}"

                                  required="true" requiredMessage="le champ date Fin est obligatoir"

                                  converterMessage="le champ date fin doit etre de la forme dd/mm/yyyy"

                                  binding="#{calendarFin}" validator="#{vehiculeFilterBean.validerdate}"

                                  datePattern="dd/MM/yyyy"

                                  >

                                  <a4j:ajax id="evnt" event="change"   listener="#{vehiculeFilterBean.validerdate}">

                                  </a4j:ajax>

                                  <f:attribute name="calendarDeb" value="#{calendarDeb}"></f:attribute>

                                  <f:convertDateTime type="date" pattern="dd/mm/yyyy"/>

                              </rich:calendar>

       

      i(m orking with JSF and RichFaces 4.0 final

      thinks