this still must be looked at

I think pagecount should be able to be 0 (if really no data is there.. you are displaying the list yes,, but does it display a page??)

You are right about that rowsPerPAge == 0, but that doesn't make any sense for PageableListView.
So it is more a illegalstate if that happens..

if pagecount == 0 then currentPage should just be also 0 (setting it to -1 can be done in pageablelistview but it will directly be converted to 0 then)

johan


Christian Essl wrote:
Thanks Johan foor providing IPageable, it looks realy good.

I just tried to implement it and had a border-line question:
In case the list size is 0 should getPageCount() return 0 and getCurrentPage() return -1. Or does getPageCount() have to always return at least 1 and getCurrentPage() at least 0?.

To figure this out I was looking into PabeableListView, which implements:

int getPageCount(){
 return ((getList().size() + rowsPerPage) - 1) / rowsPerPage;
}

First I think if rowsPerPage is 0 than this will throw an Exception.

Otherwise if list.size == 0 than it always returns 0. Ok. But than I think the bounding in setCurrentPage() sets the currentPage either to 0 or -1 depending on the argument.

As said it is a border-line question and as such not so important, but a clarifying word maybe in the javadoc of IPageable would help me.

Thanks,
Christian




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