You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Korhonen, Kalle" <kk...@cisco.com> on 2005/02/01 23:30:46 UTC

RE: [jira] Created: (MYFACES-98) Allow x:dataTable to store itsdata model in the component tree

I don't think there's a bug in the implementation of preserveDataModel.
It's quite understandable that if you are using pageScroller together
with the dataTable, you have to take care of saving the data yourself.
Of course, pageScroller could have its own preserveDataModel or
something similar, but if it's used the dataTable shouldn't anymore be
responsible of saving the data. Maybe pagescroller could generate a
warning if preserveDataModel is set to true in the data table or handle
"remembering" the data or some other better implementation, but I don't
see even the current implementation as a bug.

Kalle

> -----Original Message-----
> From: Alessandro Polverini [mailto:alex@nibbles.it] 
> Sent: Tuesday, February 01, 2005 3:21 AM
> To: MyFaces Development
> Cc: Sean Schofield; martin@marinschek.com
> Subject: Re: [jira] Created: (MYFACES-98) Allow x:dataTable 
> to store itsdata model in the component tree
> 
> On Tue, 2005-02-01 at 09:25 +0100, Martin Marinschek wrote:
> > Exactly, use the preserveDataModel attribute and you are all set!
> > 
> > Manfred had a very hard time implementing that one, as far as I 
> > remember ;)
> 
> Hello Martin,
> I tried to set preserveDataModel to true to avoid the 
> x:saveState declaration, but this would not work (in my case, 
> at least).
> 
> I try to explain my situation to better understand the 
> behaviour: I have a simple form with some search parameters, 
> when the user submits it, the backing bean (request scope) is 
> populated with results and I show and paginate through them 
> using x:dataTable and x:dataScroller.
> 
> The only way I found to make it work well is:
> - set preserveDataModel to false (or to not put the attribute
> completely)
> - use a x:saveState on #{bean.results}
> 
> Whithout doning this, I can see only the first page of 
> results and every other action (for example switch to page 
> #2) the datas are lost and no more rows are displayed.
> The problem also occurs if I *both* use saveState and 
> preserveDataModel, maybe because the partially conflicts in 
> their operation?
> 
> So, I deduce that preserveDataModel does not the very same 
> thing of saveState, and maybe the idea of Sean is useful anyway?
> 
> Or maybe preserveDataModel has a bug (or a limitation) and 
> should be fixed?
> 
> I would be interested to better understand this issue.
> 
> Thanks,
> Alex
> 
> 

RE: [jira] Created: (MYFACES-98) Allow x:dataTable to store itsdata model in the component tree

Posted by Alessandro Polverini <al...@nibbles.it>.
On Tue, 2005-02-01 at 14:30 -0800, Korhonen, Kalle wrote:
> I don't think there's a bug in the implementation of preserveDataModel.
> It's quite understandable that if you are using pageScroller together
> with the dataTable, you have to take care of saving the data yourself.
> Of course, pageScroller could have its own preserveDataModel or
> something similar, but if it's used the dataTable shouldn't anymore be
> responsible of saving the data. Maybe pagescroller could generate a
> warning if preserveDataModel is set to true in the data table or handle
> "remembering" the data or some other better implementation, but I don't
> see even the current implementation as a bug.

Hello Kalle, and thanks for your reply.
I don't understand well why preserveDataModel should not work if used
with pageScroller. PageScroller is just a "normal" component providing
pagination, what would differ if I implement it in my program instead of
using it?
What I mean is: if the array is correctly restored for my application,
why it should not work for pageScroller?

Anyway, since they both are myfaces components, I expect them to
correctly work together so a warning or something similar in the
documentation would be welcome.

Thanks,
Alex

> -----Original Message-----
> > From: Alessandro Polverini [mailto:alex@nibbles.it] 
> > Sent: Tuesday, February 01, 2005 3:21 AM
> > To: MyFaces Development
> > Cc: Sean Schofield; martin@marinschek.com
> > Subject: Re: [jira] Created: (MYFACES-98) Allow x:dataTable 
> > to store itsdata model in the component tree
> > 
> > On Tue, 2005-02-01 at 09:25 +0100, Martin Marinschek wrote:
> > > Exactly, use the preserveDataModel attribute and you are all set!
> > > 
> > > Manfred had a very hard time implementing that one, as far as I 
> > > remember ;)
> > 
> > Hello Martin,
> > I tried to set preserveDataModel to true to avoid the 
> > x:saveState declaration, but this would not work (in my case, 
> > at least).
> > 
> > I try to explain my situation to better understand the 
> > behaviour: I have a simple form with some search parameters, 
> > when the user submits it, the backing bean (request scope) is 
> > populated with results and I show and paginate through them 
> > using x:dataTable and x:dataScroller.
> > 
> > The only way I found to make it work well is:
> > - set preserveDataModel to false (or to not put the attribute
> > completely)
> > - use a x:saveState on #{bean.results}
> > 
> > Whithout doning this, I can see only the first page of 
> > results and every other action (for example switch to page 
> > #2) the datas are lost and no more rows are displayed.
> > The problem also occurs if I *both* use saveState and 
> > preserveDataModel, maybe because the partially conflicts in 
> > their operation?
> > 
> > So, I deduce that preserveDataModel does not the very same 
> > thing of saveState, and maybe the idea of Sean is useful anyway?
> > 
> > Or maybe preserveDataModel has a bug (or a limitation) and 
> > should be fixed?
> > 
> > I would be interested to better understand this issue.
> > 
> > Thanks,
> > Alex
> > 
> >