7 Replies Latest reply on Nov 18, 2009 5:52 AM by Ilya Shaikovsky

    rich:calendar js exception on IE 8

    Eugene Kisly Newbie

      Hello
      jboss 5.1
      richfaces 3.3.2.SR1

      when i first time open any page with rich: calendar, i get javascript exception at jquery.js.jsf 223
      all works good, but this exception is not good

      in ff 3.5.5 all right

      source

      <h:outputText value="#{attributes.documentDate}"/>
      <h:panelGroup>
      <rich:calendar id="documentDate" label="#{attributes.documentDate}" value="#{formulaConstructorPageBean.document.documentDate}"
      datePattern="dd.MM.yyyy"
      cellWidth="24px"
      inputClass="input"
      style="width:200px"
      cellHeight="22px"
      enableManualInput="false">
      <rich:ajaxValidator event="onblur"/>
      </rich:calendar>
      <rich:message for="documentDate" styleClass="errorMessage"/>

      </h:panelGroup>



      bean code


      protected Date documentDate;

      public void setDocumentDate(Date value) {
      this.documentDate = value;
      }

      public Date getDocumentDate() {
      return documentDate;
      }


        • 1. Re: rich:calendar js exception on IE 8
          Ilya Shaikovsky Master

          JSF version? do you have external script libraries used on this page?

          • 2. Re: rich:calendar js exception on IE 8
            Eugene Kisly Newbie

            JSF:

            Manifest-Version: 1.0
            Specification-Title: JavaServer Faces
            Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
            Ant-Version: Apache Ant 1.6.5
            Implementation-Title: Mojarra
            Specification-Vendor: JBoss (http://www.jboss.org/)
            Specification-Version: 1.2MR2
            Implementation-Vendor-Id: com.sun
            Extension-Name: com.sun.faces
            Implementation-Version: 1.2_09-b01-BETA1
            Implementation-Vendor: Sun Microsystems, Inc.
            Implementation-URL: http://www.jboss.org/


            Script:


            Only own custom js file, without other libraries.

            • 3. Re: rich:calendar js exception on IE 8
              Eugene Kisly Newbie

              Head element:

              <head>
              <title>STP</title>
              <link rel="icon" type="image/x-icon" href="./theme/images/favicon.ico">
              <link rel="stylesheet" type="text/css" href="./theme/main.css"/>
              <script type="text/javascript" language="JavaScript" src="scripts/common.js"></script>
              </head>




              • 4. Re: rich:calendar js exception on IE 8
                Eugene Kisly Newbie

                Sorry

                <head>
                 <title>STP</title>
                 <link rel="icon" type="image/x-icon" href="./theme/images/favicon.ico">
                 <link rel="stylesheet" type="text/css" href="./theme/main.css"/>
                 <script type="text/javascript" language="JavaScript" src="scripts/common.js"></script>
                </head>


                • 5. Re: rich:calendar js exception on IE 8
                  Eugene Kisly Newbie

                  Exception is:

                  Объект не поддерживает �то �вой�тво или метод

                  jquery.js.jsf.223: symbol 380 and

                  if(div.getElementsByClassName("e").length===0)

                  is marked by IE script debugger

                  • 6. Re: rich:calendar js exception on IE 8
                    Eugene Kisly Newbie

                    And next one is in JQuerySpinBtn.js.jsf at line 2 and code marked by ie script debagger is:

                    sbjQuery.fn.SpinButton=function(cfg){return this.each(function(){this.spinCfg={min:cfg&&!isNaN(parseFloat(cfg.min))?Number(cfg.min):null,max:cfg&&!isNaN(parseFloat(cfg.max))?Number(cfg.max):null,step:cfg&&cfg.step?Number(cfg.step):1,page:cfg&&cfg.page?Number(cfg.page):10,upClass:cfg&&cfg.upClass?cfg.upClass:'up',downClass:cfg&&cfg.downClass?cfg.downClass:'down',reset:cfg&&cfg.reset?cfg.reset:this.value,delay:cfg&&cfg.delay?Number(cfg.delay):500,interval:cfg&&cfg.interval?Number(cfg.interval):100,_btn_width:20,_btn_height:12,_direction:null,_delay:null,_repeat:null,digits:cfg&&cfg.digits?Number(cfg.digits):1};this.adjustValue=function(i){var v=this.value.toLowerCase();if(v=="am")
                    {this.value="PM";return;}
                    else if(v=="pm"){this.value="AM";return;}
                    v=(isNaN(this.value)?this.spinCfg.reset:Number(this.value))+Number(i);if(this.spinCfg.min!==null)v=(v<this.spinCfg.min?(this.spinCfg.max!=null?this.spinCfg.max:this.spinCfg.min):v);if(this.spinCfg.max!==null)v=(v>this.spinCfg.max?(this.spinCfg.min!=null?this.spinCfg.min:this.spinCfg.max):v);var value=String(v);while(value.length<this.spinCfg.digits)value="0"+value;this.value=value;};sbjQuery(this).keydown(function(e){switch(e.keyCode){case 38:this.adjustValue(this.spinCfg.step);break;case 40:this.adjustValue(-this.spinCfg.step);break;case 33:this.adjustValue(this.spinCfg.page);break;case 34:this.adjustValue(-this.spinCfg.page);break;}}).bind("mousewheel",function(e){if(e.wheelDelta>=120)
                    this.adjustValue(this.spinCfg.step);else if(e.wheelDelta<=-120)
                    this.adjustValue(-this.spinCfg.step);e.preventDefault();}).change(function(e){this.adjustValue(0);});var self=this;var btnUp=$(this.id+'BtnUp');sbjQuery(btnUp).mousedown(function(e){var adjust=function(){self.adjustValue(self.spinCfg.step);};adjust();self.spinCfg._delay=window.setTimeout(function(){adjust();self.spinCfg._repeat=window.setInterval(adjust,self.spinCfg.interval);},self.spinCfg.delay);self.spinCfg._repeater=true;return false;}).mouseup(function(e){self.spinCfg._repeater=false;window.clearInterval(self.spinCfg._repeat);window.clearTimeout(self.spinCfg._delay);}).dblclick(function(e){if(sbjQuery.browser.msie)
                    self.adjustValue(self.spinCfg.step);}).mouseout(function(e){if(self.spinCfg._repeater)
                    {self.spinCfg._repeater=false
                    window.clearInterval(self.spinCfg._repeat);window.clearTimeout(self.spinCfg._delay);}});var btnDown=$(this.id+'BtnDown');sbjQuery(btnDown).mousedown(function(e){var adjust=function(){self.adjustValue(-self.spinCfg.step);};adjust();self.spinCfg._delay=window.setTimeout(function(){adjust();self.spinCfg._repeat=window.setInterval(adjust,self.spinCfg.interval);},self.spinCfg.delay);self.spinCfg._repeater=true;return false;}).mouseup(function(e){self.spinCfg._repeater=false;window.clearInterval(self.spinCfg._repeat);window.clearTimeout(self.spinCfg._delay);}).dblclick(function(e){if(sbjQuery.browser.msie)
                    self.adjustValue(-self.spinCfg.step);}).mouseout(function(e){if(self.spinCfg._repeater)
                    {self.spinCfg._repeater=false
                    window.clearInterval(self.spinCfg._repeat);window.clearTimeout(self.spinCfg._delay);}});if(this.addEventListener){this.addEventListener('DOMMouseScroll',function(e){if(e.detail>0)
                    this.adjustValue(-this.spinCfg.step);else if(e.detail<0)
                    this.adjustValue(this.spinCfg.step);e.preventDefault();},false);}});function coord(el,prop){var c=el[prop],b=document.body;while((el=el.offsetParent)&&(el!=b)){if(!sbjQuery.browser.msie||(el.currentStyle.position!='relative'))
                    c+=el[prop];}
                    return c;}};


                    • 7. Re: rich:calendar js exception on IE 8
                      Ilya Shaikovsky Master

                      please
                      1) remove all your custom script and re-check

                      if the problem still there
                      1) remove compression of scripts in web.xml and provide information about where the error occurs (line)
                      2) inform about precise IE8 version
                      3) inform us about document type and browser mode.