myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Korhonen, Kalle" <kkorh...@cisco.com>
Subject RE: [jira] Created: (MYFACES-98) Allow x:dataTable to storeitsdata model in the component tree
Date Wed, 02 Feb 2005 22:51:04 GMT
> -----Original Message-----
> From: Alessandro Polverini [mailto:alex@nibbles.it] 
> Subject: RE: [jira] Created: (MYFACES-98) Allow x:dataTable 
> to storeitsdata model in the component tree
> 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.
> 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?

Oh, the reason is simple. Since the preserveDataModel saves only what
the dataTable displays, and pageScrollers divides the data into multiple
pages, preserveDataModel happily remembers only the results displayed on
the first page.
 
> 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.

I 100% agree with you there. Even better, pageScroller could "take
over", force the preserveDataModel in the datatable to reset to false
and/or have its own preserveDataModel. Volunteering to implement that?
:)

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
> > > 
> > > 
> 
> 

Mime
View raw message