4 Replies Latest reply on Sep 20, 2010 3:45 PM by bek816

    A4J Updating all rows in datatable

    bek816

      I have a data table with a subtable like the following:

       

      A B C

      A B C

      .....

       

      And so on.  Every time I modifiy anything in column A, I want to re-render all Cs (in all rows).  I can get it to update the "C" in the row that was updated, but short of updating the whole table, is there anyway to update all "C" regardless of which row was modified?  I tried using an a4j:output panel (on each row) with ajaxRendered=true, but it still wouldn't re-render rows outside the row that was modified.  Is it possible to re-render all rows in a datatable without re-rendering the whole table?

       

      Thanks.

        • 1. Re: A4J Updating all rows in datatable
          bek816

          Can we use AjaxKeys for this?

          • 2. Re: A4J Updating all rows in datatable
            liuliu

            no, ajaxkeys is for the row,

            but i think you can rerender the id of column.

            • 3. Re: A4J Updating all rows in datatable
              bek816

              So using my example, if I have three rows:

               

              A1 B1 C1

              A2 B2 C2

              A3 B3 C3

               

              If I update A1, I want to re-render C1, C2, and C3 without re-rendering the whole table.  Can I set AjaxKeys to all rows?  I tried re-rendering the column id, but it still wouldn't look outside the row that was modified.

              • 4. Re: A4J Updating all rows in datatable
                bek816

                We solved the problem using AjaxKeys.  Note the problem was a little more complicated because we had a subtable.  We discovered that the default behaviour of AjaxKeys is to update the row that was updated.  Interestingly, if AjaxKeys was null, or something that couldn't be resolved, it updated all rows.  In the end, we definitely AjaxKeys for the main table and all subtables.  We populated all of the keys based on the number of rows in each table or subtable.  That solved our problem of updating specific columns in all of the rows instead of updating the entire datatable.