3 Replies Latest reply on Jan 12, 2010 11:44 AM by rodrigo.uchoa

    rich:calendar onchanged/oninputchange does not work on IE 7

    rodrigo.uchoa

      Hello,

       

      I need to add an "onchange" event in a rich:calendar element. Problem is the two events mentioned above, onchanged and oninputchange, are not working correctly on IE 7. As a matter of fact, I think only "oninputblur" is firing correctly on IE 7.

       

      In Firefox 3, only oninputchange works ok. Here's a code snippet of what I'm trying to do:

       

       

      <rich:calendar label="Vigência" id="dataVigencia" value="#{concessao.dataVigencia}" datePattern="dd/MM/yyyy" inputSize="7" enableManualInput="true" oninputblur="mascaraData(this);" maxlength="10" oninputkeypress="return formataData(event, this);" firstWeekDay="0" showWeeksBar="false" todayControlMode="hidden" validator="#{dadosConcessaoBean.validarDataVigencia}">
                                  <f:attribute name="dataPublicacao" value="dadosConcessaoForm:concessaoPublicacaoData" />
                                  <f:validator validatorId="dataRangeValidator" />
                                  <f:validator validatorId="dataObitoValidator" />
                                  <a4j:support event="oninputchange" reRender="divAto, divVantagens" ajaxSingle="true" status="statusAjax" eventsQueue="atoTabControl" />                           
      </rich:calendar>

       

      Anyone have a clue?

       

      ps: I'm using richfaces 3.3.1 GA

        • 1. Re: rich:calendar onchanged/oninputchange does not work on IE 7
          ilya_shaikovsky

          onchanged and oninputchange, are not working correctly on IE 7

           

          could you please clarify this more.cecked and seems fine for me.

          • 2. Re: rich:calendar onchanged/oninputchange does not work on IE 7
            rodrigo.uchoa

            You're right. I messed up a little bit.

             

            After further investigation, I realized that only the ONINPUTCHANGE event is not firing in IE7. When the user manually edit the input field with a new date, no event is fired. The ONCHANGED event on the other hand, is fired correctly when the user selects a new date with the mouse. For instance, try this example:

             

            <rich:calendar onchanged="alert('onchanged');" oninputchange="alert('oninputchange');" label="Vigência" id="dataVigencia" value="#{transferirArquivoAction.dateTeste}" datePattern="dd/MM/yyyy" inputSize="7" enableManualInput="true"
                                    oninputblur="mascaraData(this);" maxlength="10" oninputkeypress="return formataData(event, this);" firstWeekDay="0" showWeeksBar="false" todayControlMode="hidden" >                                   
            </rich:calendar>

             

             

            Run this code in IE7 and try to edit a new date manually. The alert 'oninputchange' will never run.

            • 3. Re: rich:calendar onchanged/oninputchange does not work on IE 7
              rodrigo.uchoa

              Guys,

               

              I already found out what the problem was. Some of the JS functions I was calling in 'oninputblur' and 'oninputkeypress' were interfering with the oninputchange event.

               

              Regards!