the rowstate is not serialized with the view. If validation fails the
submitted value of any input component is rendered in the response.
IMO it is not necessary to save the sate of each row if validation
fails since the values are submitted again through the next request.

In any case saving this rowstate value would not save the complete
state for every component in the row since saveState/restoreState is
not called for the components. Only EditableValueHolder components and
their current values of the attributes value, submittedvalue, valid
and localvalueset are saved in this state. Any other stateful
component in a datatable can not be used anyway (its state would not
be saved for each row between requests).

To make saving the state for each row work for every component we
would need to implement UIData.saveState/restoreState to iterate
through the rows and call processSaveState/processRestoreState for
each uicolumn and serialize this with the view. This would make every
component work inside a datatable. But I think we need to keep in mind
that this may produce a really big state which must be rendered in the
response if client side state is used and the datatable contains a lot
of rows.

I suggest to implement it in t:datatable with an aditional switch
parameter. So users who need it can enable this rowstate saving
between requests.

2005/11/29, Manfred Geiler <[EMAIL PROTECTED]>:
> That's a perfect question and an important issue.
> Indeed there was such a "save descendant states" logic in my original
> UIData code. As I remember this was one of the more complex parts.
> States where only to be saved when all children where valid, and so
> on. Well, this logic has vanished during the refactoring by Mathias
> Broekelmann.
>
> Mathias, can you please disclose your rationale to drop this?!
>
> Thanks,
> Manfred
>
>
> 2005/11/29, Simon Kitching <[EMAIL PROTECTED]>:
> > Hi,
> >
> > The UIData uses the "flyweight" pattern so that a single set of
> > component children for a single row are enough to implement a table with
> > any number of rows. The state for each row is stored in _rowState.
> >
> > When a view is serialized, the state for ordinary components is stored.
> > I presume that the _rowState is also stored at the same time, and for
> > the same reasons. Among other things I believe this info would be
> > necessary to re-rended submitted values for input fields if validation
> > should fail.
> >
> > But I just can't see anything in the UIData component that saves the
> > _rowState.
> >
> > Can anyone give me a hint?
> >
> > Thanks,
> >
> > Simon
> >
>


--
Mathias

Reply via email to