2 Replies Latest reply on Feb 28, 2011 8:54 AM by manakor

    Rerendering HTML5 content with a4j:jsFunction brakes markup

    manakor

      I am working in JSF2 project and faced the error, which breaks native HTML5 tags display in the browser. So, what I have:

      <a4j:form id="myForm">

      <a4j:jsFunction name="myFunction" actionListener="#{myBean.key}"

            ignoreDupResponses="true"

           eventsQueue="myQueue"

           oncomplete="alert('Done');"

           reRender="wrapper">

        </a4j:jsFunction>

       

       

      <a4j:outputPanel id="wrapper" layout="block">

       

           <!-- Inside this panel I have HTML5 tags -->

           <aside>

                <div class="myObject">

                     <p>Lorem impsum dolor sit amet...</p>

                </div>

           </aside>

           <nav>

                <a href="#" title="">My Link #1</a>

                <a href="#" title="">My Link #2</a>

           </nav>

       

      </a4j:outputPanel>

       

       

      <div class="anotherObject">

           <a href="#" title="" onclick="myFunction(); return false;">Refresh my wrapper</a>

      </div>

      </a4j:form>

       

      So, right after I click a link, which activates myFunction() on click event, <a4j:outputPanel> content is rerendered, but broken, because HTML5 tags are dropped outside, and when I debug in Firebug, code of outputPanel looks like this:

       

           <div id="myForm:wrapper">

                <aside> </aside>

                <nav> </nav>

                <!-- And right here starts all my content, which has to be inside those HTML5 tags -->

                <div class="myObject">

                     <p>Lorem impsum dolor sit amet...</p>

                ...

           </div>

       

      Maybe somebody knows why this rerendering brakes my HTML?!

        • 1. Rerendering HTML5 content with a4j:jsFunction brakes markup
          ilya_shaikovsky

          you using RichFaces 3.x? Try to turn filter off using NONE for context parameter.

          <context-param>

                              <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>

                              <param-value>NONE</param-value>

                    </context-param>

          But in that case be carefull as your markups will not be checked for correctness and Ajax could be broken in case some page parts are not w3c-complaint.

          • 2. Rerendering HTML5 content with a4j:jsFunction brakes markup
            manakor

            <context-param>

                                <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>

                                <param-value>NONE</param-value>

            </context-param>

             

            For me worked, but I wish to know what's the problem of JSF when it cleans the code than? Why it doesn't take in mind HTML5 elements?