0 Replies Latest reply on Jun 21, 2008 8:50 PM by rhinox

    reRender breaks innerHTML property in Opera 9

    rhinox

      The following test fails in Opera 9 but not in IE or Firefox:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:t="http://myfaces.apache.org/tomahawk"
       xmlns:a4j="http://richfaces.org/a4j">
      <f:view>
       <t:documentHead>
       <title>Test</title>
       <script type="text/javascript">
       function displayInnerHTML() {
       alert(document.getElementById("div1").innerHTML);
       }
       </script>
       </t:documentHead>
       <t:documentBody>
       <t:div id="div1">
       <t:div id="div11">
       <h:outputText styleClass="someClass" value="Hello World 1!"/>
       </t:div>
       <t:div id="div12">
       <h:outputText styleClass="someClass" value="Hello World 2!"/>
       </t:div>
       </t:div>
       <h:form>
       <a4j:commandLink value="Display Inner HTML for Div1" reRender="div1" limitToList="true" oncomplete="displayInnerHTML()"/>
       </h:form>
       <script type="text/javascript">
       displayInnerHTML();
       </script>
       </t:documentBody>
      </f:view>
      </html>


      First time page is loaded, the Javascript function displayInnerHTML() works fine, this is the response displayed by the function:

      <DIV id="div11"><SPAN class="someClass">Hello World 1!</SPAN></DIV><DIV id="div12"><SPAN class="someClass">Hello World 2!</SPAN></DIV>


      After commandLink is invoked and reRender is applied, Richfaces "eats" every single closing tag of element DIV1 and its childs breaking the DOM hierarchy and making useless the reRendered response, this is the result displayed by the function:

      <DIV id="div11"><SPAN class="someClass">Hello World 1!<DIV id="div12"><SPAN class="someClass">Hello World 2!


      I'm using:
      Tomahawk 1.1.7
      Richfaces 3.2.1 GA
      Opera 9
      Firefox 2.x and 3
      IE 7

      Please HELP.

      Thanks