[jsr-314-open-mirror] [jsr-314-open] Fix UIData state saving model (issue 153)

Leonardo Uribe lu4242 at gmail.com
Wed May 26 02:55:46 EDT 2010


Hi Martin

2010/5/25 Martin Marinschek <mmarinschek at apache.org>

> Hi Leonardo,
>
> ok
>
> > If we have some code on UIData.markInitialState() we have to call
> > clearInitialState
> > on all children, save the component initial state and call again
> > markInitialState. The
> > idea behind do not call UIComponent.markInitialState() on
> > ComponentTagHandlerDelegate,
> > is in avoid do that in reverse order and just do it in one step.
>
> well, you need to have all children constructed, when
> markInitialState() is called on the table, right? Is that what it
> boils down to?
>
>
When markInitialState() is called on the table, we need to save the state of
all children
inside the table component. Later, when UIData.setRowIndex is called we use
that
information to restore the initial state first of each component and then
apply the delta.

Right now, when markInitialState() is called on the table, all children
inside the table has
been already marked, so we need to call clearInitialState() on all children,
then call saveState()
to get the required information and then call again markInitialState().

I tried to find an alternative to not traverse the tree calling
markInitialState() as suggested,
and use something different like a listener to PostAddToViewEvent, but I
found that it will not
work, because it is possible to create a tag that add some attached object
to a component
on this event (for example: t:autoScrollPage).

regards,

Leonardo Uribe


> > on the state. The code proposed additionally save and restore the delta,
> and
> > the
> > delta per row is saved on UIData state.
>
> ok
>
> >
> >> By the way - I don´t like Alexander´s idea of having a
> >> restoreRowState/saveRowState (this additional API would only be useful
> >> inside repeater-components). Instead, I would propagate a
> >> getTransientAttributesMap() API, and the repeating-component would
> >> just take care of saving/restoring this as well. I believe this API
> >> could be used for a lot of other stuff. It would essentially a
> >> component-request scope, which we don´t have yet, and for which we had
> >> quite a few usages in cs-JSF already.
> >>
> >> We could also embed this state in the stateMap with a transient=true
> >> attribute, that´s the other option - then it won´t be a public API
> >> however.
> >>
> >>
> > The important here is provide methods to save and restore that
> map/variable
> > set.
> > As long as we have some way to do that, we could call it from
> > UIData.setRowIndex. I like the idea to extend StateHelper with accesors
> > and save/restore methods for transient components.
>
> I agree.
>
> Can we add this to our JSF 2.1 roadmap?
>
> best regards,
>
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20100526/0ee7c082/attachment-0002.html 


More information about the jsr-314-open-mirror mailing list