3 Replies Latest reply on Sep 17, 2008 6:09 AM by thonis meta

    rerender of only newly inserted datatable-rows possible?

    thonis meta Newbie

      dear community,

      we are looking for a way to rerender only newly inserted rows of a datatable. is this possible with richfaces?

      let me explain our use case:

      we just built a kind of expandable treetable by using a rich:datatable and subtables that only have data when the associated top level row in the datatable is expanded; a click on a "expand row"-link at the beginning of a datatable row fetches the data for the subtable and initiates a rerender of the whole datatable; this worked ok.

      as more and more rows are expanded, the table gets longer and longer, and the rerender process needs too much time.
      so i tried to accomplish a partial rerender of only the recently expanded subtable;

      that means: on first full render of the whole page, all the subtables point to an empty list, so no subtable rows are rendered;
      after clicking on the "expand row"-link, which now has a "rerender='subtable'", the subtable finds data to render;
      richfaces correctly sends the content of all the new subtable rows to the browser, but the browser does not update anything in the datatable;

      i looked into the richfaces ajax console and it was obvious:

      Attempt to update part of page for Id: stForm:mainTable:0:subTreeTable
      call getElementById for id= stForm:mainTable:0:subTreeTable
      New node for ID stForm:mainTable:0:subTreeTable is not present in response


      as the subtable has no dom-element representing the subtable, the browser cannot change the content of this dom element.

      so my problem is a more general one:

      how can i insert some rows into a datatable/subtable and then show these fresh rows without a full rerender of the whole table?

      thanks in advance for any help,

      thonis.