I like the idea of having enablePaging(int rowsperpage) instead of
setrowsperpage(int rowsperpage) because to me it makes it more clear what
you are doing. Im not totally sure that's the way to go, since
setrowsperpage(int rowsperpage) could be used in some interface down the
road, while the enable/disable pair is somewhat awkward for interfaces. I
can go either way, anyone else have an opinion?

-Igor


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Christian Essl
> Sent: Saturday, September 03, 2005 9:48 AM
> To: wicket-user@lists.sourceforge.net
> Subject: Re: [Wicket-user] PageableGridDataView
> 
> On Sat, 3 Sep 2005 07:48:09 -0700, Igor Vaynberg 
> <[EMAIL PROTECTED]>
> wrote:
> 
> > Doh,
> > Now we have two alternative impls, do you mind quickly 
> comparing the 
> > two and seeing advantages/disadvantages.
> Not at all. That's what my impl is for.
> 
> First if there is no use-case than I am also for getting rid 
> of setStartIndex and viewSize. As you said they do not make 
> much sense and you can achieve the same effect as my impl 
> with a delgating data-provider if it is realy needed.
> 
> setCurrentPage(): I think this is something which has to be 
> made clear in the IPageable interface and DataView should 
> strictly adhere to that. Who does the bounding the setter or 
> the implementor? If the setter has to do it the interface 
> should delcare an IndexOutOfBoundsEx if not it should - as 
> you said - return an int. Unfurtunately we can not currently 
> implement your IMO optimal compromise (returning an int). I 
> am for returning an int (a change of IPagealbe), and still 
> keep the boundCurrentPage() method as a strategy to do the 
> bounding in DataView.
> 
> disablePaging(): You are right it is more clear to the user. 
> Maybe we should implement it as a convinience method:  void 
> disablePaging(){setItemsPerPage(Integer.MAX_VALUE);}
> 
> I'd like to keep the populateItems(int first,int count) 
> method, because I think all these index-calculations should 
> be encapsulated in one class.
> 
> Finally I think we should stay with your implementation 
> because it is much more consistent with the old DataView.
> 
> Christian
> 
> 
> 
> 
> 
> My impl doesn tuse the OIR helper yet
> > which
> > I would like to integrate in the future.
> >
> >>
> >> 1.) IPageable: Paging is always enabled. By default it 
> behaves like 
> >> items per page is set to Integer.MAX_VALUE. In this case 
> there is no 
> >> PageableSupportDelegate (is null) and there is (always) 
> only one page 
> >> which shows everything.
> >> setCurrentPage() does not throw an exception but bounds the value 
> >> always to 0. I think that is also consistent with what we 
> have said 
> >> about page bounding.
> >
> > Almost same. setCurrentPage() will however throw an 
> exception when the 
> > paging is off. I don't think ignoring it silently is good, as a 
> > compromise we can change setCurrentPage from void to int 
> and have it 
> > return the actual page number it set to, that way it would 
> be safe to 
> > have
> > setCurrentPage(5)
> > return zero when paging is off. What do you think? The user 
> can then 
> > do the check and make sure the expected value is returned, 
> or throw an 
> > error if the page num is critical.
> >
> >>
> >> When  items-per-page is set to something other than 
> Integer.MAX_VALUE 
> >> than the PageableSupportDelegate is created and everyhting is 
> >> delegated.
> >
> > I have a little helper disablePaging() that does exactly 
> this. It's a 
> > burden on the user to know to set pagesperrow to I.MAX_VALUE, 
> > disablePaging() makes it a bit more obvious.
> >
> >>
> >> 2.) I changed the startIndex and the viewSize to be actually 
> >> 'filters' in the IDataProvider. To make this clear I also renamed 
> >> them to dataStartIndex and dataMaxSize. The startIndex 
> >> (dataStartIndex) is an offset in the IDataProvider and the 
> viewSize 
> >> (dataMaxSize) gives an upper limit to the items gotten from the 
> >> IDataProvider. Pageing happens than within this restricted 
> data-set. 
> >> I guess if there is items-per-page Integer.MAX_VALUE 
> (default) this 
> >> behaves like an old DataView.
> >
> > Im for getting rid of these. You cant really use startIndex in the 
> > paging scope. If you set it to something other then zero and enable 
> > paging, you wont be able to get to some records because 
> they will be 
> > out of page scope.
> > Viewsize is kind of obsolete with paging and I don't think 
> we need it.
> >
> > -Igor
> >
> >
> >
> >
> > -------------------------------------------------------
> > SF.Net email is Sponsored by the Better Software Conference & EXPO 
> > September 19-22, 2005 * San Francisco, CA * Development Lifecycle 
> > Practices Agile & Plan-Driven Development * Managing 
> Projects & Teams 
> > * Testing & QA Security * Process Improvement & Measurement * 
> > http://www.sqe.com/bsce5sf 
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 
> 
> --
> Christian Essl 
> 
>       
> 
>       
>               
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - 
> Hier anmelden: http://mail.yahoo.de
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development 
> Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * 
> Testing & QA
> Security * Process Improvement & Measurement * 
> http://www.sqe.com/bsce5sf
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 
> 




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to