0 Replies Latest reply on Aug 31, 2007 1:51 AM by alekseisosnovski

    reRender table row

    alekseisosnovski

      Hello,

      I have a custom component that renders a table row. I need to reRender it using a4j. However I get some problems with it. Everything goes OK until processing response to well-formed XML. Here is what org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser does:

      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : img lacks "alt" attribute
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : missing <tbody>
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : content occurs after end of body
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : <tr> isn't allowed in <body> elements
      rg.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : inserting implicit <table>
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : missing <tbody>
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : <div> isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : missing </div> before <div>
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : <div> isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : <script> isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : discarding unexpected </div>
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : meta isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : meta isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : <span> isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : meta isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : meta isn't allowed in <tbody> elements
      org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser - Message for HTML parsing : missing </table> before </html>
      


      It adds table and tbody tags and discards some other elements. As a result, some data is missing in response:

      error[8:28:35,718]: New node for ID msgTabbedPane:messagesSourceContainer is not present in response
      


      It also causes javascript error in IE 7 (Unknown runtime error) In FF works except that some data is missing in response and therefore some parts of page are not rerendered. Below are added parts of "good" response (reRenders some div) and "bad" response (reRenders tr) that contain data about elements to reRender. What I noticed is that span id="ajax-update-ids" is missing in second response.

      "Good" response
      <!-- MYFACES JAVASCRIPT -->
       <div id="msgTabbedPane:messagesSourceContainer" style="text-align: center;">
       <div id="hiddenMessagesContainer" style="display: none;"></div>
       <script type="text/javascript">//<![CDATA[
       document.getElementById('messagesContainer').innerHTML =
       document.getElementById('hiddenMessagesContainer').innerHTML;
       //]]>
       </script>
       </div>
      
       <meta
       name="Ajax-Update-Ids"
       content="msgTabbedPane:messagesSourceContainer" />
      
       <span id="ajax-update-ids">
       <input
       type="hidden"
       name="jsf_sequence" value="1" />
       <input
       type="hidden"
       name="com.sun.faces.VIEW"
       id="com.sun.faces.VIEW"
       value="_id5:_id13" />
       </span>
      
       <meta id="Ajax-Response" name="Ajax-Response" content="true" />
      


      "Bad" response
      <!-- MYFACES JAVASCRIPT -->
       <table>
       <tbody>
       <tr id="msgTabbedPane:infoTab:deadlineRowGroup">
       <td>
       <span style="margin-right: 0px; padding-right: 0px;">Töötlemistähtaeg (kellaaeg)</span>
       <span style="color: #FF0000;">*</span>
       </td>
       <td colspan="1">
       <span
       id="msgTabbedPane:infoTab:msgDeadlineTime_rw"
       style="display: inline;">
       <input
       id="msgTabbedPane:infoTab:msgDeadlineTime"
       name="msgTabbedPane:infoTab:msgDeadlineTime" type="text"
       value="11:50"
       onkeydown="return uMask(this, event, 'xx:xx', ':', 'x');"
       class="text_active" />
       </span>
       <span id="msgTabbedPane:infoTab:msgDeadlineTime_ro" style="display: none;"></span>
       </td>
       </tr>
      
       <meta
       name="Ajax-Update-Ids"
       content="msgTabbedPane:messagesSourceContainer,msgTabbedPane:infoTab:deadlineRowGroup" />
      
       <meta id="Ajax-Response" name="Ajax-Response" content="true" />
       </tbody>
       </table>
      


      Is it possible to reRender table row without rerendering the whole table? If it is, then how? Rerendering whole table or content of each cell of table row is impossible in my case.

      I use Ajax4jsf 1.1.1 and JSF 1.1_02-b08 (Sun's RI).

      Thanks in advance for your help.