Karam Singh Badesha wrote:
> Ken,
>> - I can update the table data using a handler (where number of
>> columns etc might be different, right? Because I have some drop down
>> boxes on the page and depending on the input number of columns could
>> change.
>> Yes, however, when the data changes you'll need to recreate the
>> table. You can do this by navigate()'ing or redirect()'ing to the
>> same page. You can't simply refresh the page since that does not
>> recreate the table.
>
> But if I redirect to the same page, will the beforeCreate events will
> run again or not? If I redirect to the same page, I would have to use
> pageSession instead of attribute?
beforeCreate events would be fired again. And you'd get a new
pageSession object, so variables stored there would be gone. You'd have
to pass them in the request, or store them in session.
> Before I was passing the new table data and tableRowGroup id to a
> handler (called from command event) which will eventually use
> setLists(newData) function of MultipleListDataProvider and update the
> existing table. Now moving forward I am thinking I need to pass new
> table data, column names data and new tableRowGroup id to the same
> kind of handler to update the data. Will that not work?
This may work. If it alters the structure of the table, then you'll
need to re-create the UIComponents. This is not easy to do manually
(which is why I suggested redirecting to the page to recreate
everything). However, it is possible to remove parts of the UIComponent
tree and force it to be recreated.
I'd suggest trying your use cases and run into the problems... when you
do, raise the issues here and we'll work through them.
Good luck!
Ken
>
> thanks
> Karam
>