Thursday, 11 March 2010

Tabular Form - Preserve Changes

In our last training (08.03-10.03.2010) there was an interesting question on how to preserve the changes made in a tabular form while paginating through it. The requirement was also to save all the changes made independant of the visible set of rows. This problem can be solved using apex collections. This page in my Demo Application holds a working example including the full description of the code.


7 comments:

  1. Hi Denes,

    the link doesn't seem to work...

    ReplyDelete
  2. Nice solution Denes! just a few points:
    What happens if you submit from say page 2 and there is a validation error on page 1? Or do you perform the validation checks when you paginate. Also, when you submit; your current solution bounces you back to page 1, when it would probably be more intuitive to stay on the current page. Cheers Simon

    ReplyDelete
  3. Simon,

    I do no validations in that example. If I save the changes, I will stay on the same page.

    Denes Kubicek

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Sohil,

    what I don't understand is what your problem has to do with the technique I described here. The way of updating the table in this example is using a collection and not the tabular form arrays. The changes made to the rows are immediatelly saved into the corresponding collection and then this collection is used to update the table.

    Denes Kubicek

    ReplyDelete
  6. Hi Denes,

    My comment is irrelevant at this place. I am sorry for that.

    Thanks,

    Sohil Bhavsar

    ReplyDelete