2 Replies Latest reply on Oct 26, 2007 10:31 AM by Brian Archer

    RF3.1.2 rich:dataTable rows attribute is breaking IE

    Brian Archer Newbie

      I recently upgraded RichFaces to 3.1.2.GA, and noticed that most of my Selenium tests broke. I tracked this down to a basic problem with the table.rows DOM array not working properly in IE (6 and 7 at least). When I looked more closely, I noticed that the dataTable now renders an attribute called 'rows' that it didn't in the 3.01 version of RF. If I remove this rows attribute from my xhtml, the table.rows DOM array works properly again.

      Is the rows attribute intended or is this a bug? I did not see the attribute when I looked up the HTML spec for the table element.

      Below is an example that demonstrates this problem. Load this in IE and turn on javascript. You should get a JS error. Now remove the rows="0" attribute and try again. You will see that the problem is gone.

      Has anyone else come across this same problem?

      Thanks.
      Brian

      -----------------------------------------------------------------------------------

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >


      <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      window.onload=function(){
      var table = document.getElementById("projSelectForm:projectTable");
      alert("table row count: " + table.rows.length);
      alert("table row 0: " + table.rows[0].innerHTML);
      }














      Title


      DHF #


      Owner


      Status


      Action






      Brian's test project


      1236


      Tester 1


      Planning


      <input
      onclick="location.href='/bacTWeb/setup/project.seam?dataModelSelection=project%3AprojectList%5B0%5D&amp;cid=8&amp;actionMethod=setup%2Fproject.xhtml%3AprojectAction.selectProject'"
      id="projSelectForm:projectTable:0:j_id76" value="Select"
      type="button" />




      New project


      1234


      Tester 1


      Planning


      <input
      onclick="location.href='/bacTWeb/setup/project.seam?dataModelSelection=project%3AprojectList%5B1%5D&amp;cid=8&amp;actionMethod=setup%2Fproject.xhtml%3AprojectAction.selectProject'"
      id="projSelectForm:projectTable:1:j_id76" value="Select"
      type="button" />













        • 1. Re: RF3.1.2 rich:dataTable rows attribute is breaking IE
          Brian Archer Newbie

          Here's the code again with HTML enabled. :(

          <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >


          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

          window.onload=function(){
          var table = document.getElementById("projSelectForm:projectTable");
          alert("table row count: " + table.rows.length);
          alert("table row 0: " + table.rows[0].innerHTML);
          }














          Title


          DHF #


          Owner


          Status


          Action






          Brian's test project


          1236


          Tester 1


          Planning


          <input
          onclick="location.href='/bacTWeb/setup/project.seam?dataModelSelection=project%3AprojectList%5B0%5D&amp;cid=8&amp;actionMethod=setup%2Fproject.xhtml%3AprojectAction.selectProject'"
          id="projSelectForm:projectTable:0:j_id76" value="Select"
          type="button" />




          New project


          1234


          Tester 1


          Planning


          <input
          onclick="location.href='/bacTWeb/setup/project.seam?dataModelSelection=project%3AprojectList%5B1%5D&amp;cid=8&amp;actionMethod=setup%2Fproject.xhtml%3AprojectAction.selectProject'"
          id="projSelectForm:projectTable:1:j_id76" value="Select"
          type="button" />













          • 2. Re: RF3.1.2 rich:dataTable rows attribute is breaking IE
            Brian Archer Newbie

            Please contact me for the code example. I'm not having any luck posting it. Thanks.