3 Replies Latest reply on May 14, 2008 5:35 AM by ronanker

    rerendering a subTable with an ajax request

    ronanker

      Is it possible to rerender a subtable with an ajax request ?

      I tried this :

      <rich:column>
      ...
      <a4j:support rerender="grandtotal, theRowTotalColumnId" />
      ...
      <rich:column>
      <rich:subTable id="grandtotal">
      ... some stuff in the subtable
      </rich:subTable>
      ...

      but I have an error on the client side when the response is coming:
      error[18:59:45,921]: New node for ID formPage:reporter:j_id_jsp_1506217200_4pc17:liste:4:grandtotal is not present in response

      but no error on the server side.

      - If I set rerender="theRowTotalColumnId", there is no error but my subtable is not rerendered (of course)

      - If I set rerender="grandtotal2, theRowTotalColumnId", there is an error on the server side (of course, there is no component with 'grandtotal2' id)

      I guess subtables do not set their id on a DOM's node and can't be rerendered by an ajax request... am I wrong ?



        • 1. Re: rerendering a subTable with an ajax request
          ronanker

          Anyone have an idea how to rerender a subtable ?

          I tried to rerender all the master datatable but in this case, at each ajax update I lose the focus that should be set on inputs in the master datatable.

          It is not really user friendly :)

          • 2. Re: rerendering a subTable with an ajax request

            subTable should be a direct child of table, not column.
            It start with . So, it you put it inside the column (td) it will be invalid structure. You need to use the table there instead of subTable.

            Focus is lost if you re-render the focused component itself. 'focus' attribute helps to set it abck, but the position of the cursor will be lost. So, try to avoid rerender itself.

            • 3. Re: rerendering a subTable with an ajax request
              ronanker

              Thanks for the reply,

              In fact I have two subtables, the first one is in the header of the master datatable and the second below column tags:

              <rich:datatable>
               <f:facet name="header">
               <rich:subTable id="grandtotal">
               ...
               </rich:subTable>
               </f:facet>
               <rich:column>
               ... <%-- some code with inputs --%>
               <a4j:support event="onchange" rerender="total, grandtotal, theRowTotalColumnId" />
               ...
               </rich:column>
               <rich:subTable id="total">
               ... some stuff in the subtable
               </rich:subTable>
               ...
              <rich:datatable>
              


              The whole page is generated as expected and works fine. My only problem is that I'm not able to rerender the subtable (grandtotal) when "onchange" event is fired.

              About the focus, I understand the limitation.