[ 
http://issues.apache.org/jira/browse/MYFACES-870?page=comments#action_12359145 
] 

Roland Huss commented on MYFACES-870:
-------------------------------------

Something seemed to went wrong again:

In popcalendar.js (revision 351688) the offset calculation is performed twice, 
one with try-catch, the other one-without:

function jscalendarHideElement( elmID, overDiv ){
     [...]
 
      // Find the element's offsetTop and offsetLeft relative to the BODY tag.
      objLeft   = obj.offsetLeft;
      objTop    = obj.offsetTop;
      objParent = obj.offsetParent;

      while( objParent.tagName.toUpperCase() != "BODY" ){
        objLeft  += objParent.offsetLeft;
        objTop   += objParent.offsetTop;
        objParent = objParent.offsetParent;
      }

      objParent = obj.offsetParent;

      // added a try-catch to the next loop (MYFACES-870)
      try {
              while( objParent.tagName.toUpperCase() != "BODY" ){
                objLeft  -= objParent.scrollLeft;
                objTop   -= objParent.scrollTop;
                objParent = objParent.parentNode;
         }
      } catch (ex) {
          // ignore
      }
      
     ...
}


You should remove the one without try-catch.....

> IE6: NPE in JavaScript when using <t:calendarInput>
> ---------------------------------------------------
>
>          Key: MYFACES-870
>          URL: http://issues.apache.org/jira/browse/MYFACES-870
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.1.1
>  Environment: Windows XP SP2
> IE6
>     Reporter: Roland Huss
>     Assignee: Bruno Aranda
>      Fix For: Nightly

>
> This Javascript error occurs in 
>  do {
>                 aTag = aTag.offsetParent;
>                 leftpos += aTag.offsetLeft;
>                 toppos += aTag.offsetTop;
>         } while(aTag.tagName!="BODY");
> when offsetParent is null. This seems to occur on occasion in IE (e.g. within 
> a div with absolute positioning). 
> The same problem is described in TAPESTRY-173 and TAPESTRY-222.
> A similar problems occurs at
>  while(objParent.tagName.toUpperCase() != "BODY" ){
>         objLeft  += objParent.offsetLeft;
>         objTop   += objParent.offsetTop;
>         objParent = objParent.offsetParent;
>       }
> Again, offsetParent can be null in IE6. An additional condition in the while 
> loop prevents this gotcha.
> These problems doesn't occur on firefox 1.0.x
> My temporary solution is to catch the NPE and simply ignore it. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to