The pageable component decides what the actual page number is

Navigator.setCurrentPage(int page) {
        pageable.setCurrentPage(page);
}

PaegableDataView.setCurrentPage(int page) { 
        if (page<0) page=0;
        if (page>=pagecount) page=pagecount-1;
        currentpage=page;
}

This handles the out of bounds quietly instead of always throwing an
exception.

-Igor


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Christian Essl
> Sent: Saturday, August 20, 2005 12:13 PM
> To: wicket-user@lists.sourceforge.net
> Subject: Re: [Wicket-user] Re: ColumnedDataProvider 
> startIndex problems
> 
> I am a bit of track now. Please help me getting back. My 
> question is who finds the real last page? The one who calls 
> setCurrentPage() (the
> navigator) or the one who implements setCurrentPage() (the 
> pageable component).
> 
> To me it currently makes no sense to speak about 
> IndexOutOfBoundExceptions or template methods, before this is 
> not clear - to me.
> 
> Please help.
> 
> Christian
> 
> On Sat, 20 Aug 2005 13:40:54 -0400, Gili 
> <[EMAIL PROTECTED]> wrote:
> 
> >
> >     I too prefer finding the *real* last page and going 
> there. At least, 
> > that makes sense for my use-case.
> >
> > Gili
> >
> > Johan Compagner wrote:
> >> hmm i don't know about this.
> >> Because the DataView is the one that gives the total 
> pagecount. The 
> >> navigator just uses it.
> >> And if the navigator sets a page that is suddenly out of 
> range then 2 
> >> things can be done:
> >>
> >> Math.min(wantedPageCount,maxPageCount)
> >>
> >> or if(wantedPageCount > maxPageCount) wantedPage = 0
> >>
> >> because the view you get in the browser is very strange.
> >> You see nothing in the list, You don't see any selection in the 
> >> navigator (because the 'currentpage' isn't listed anymore)
> >>
> >> I prefer to go the the last page. Because it wanted to 
> show data that 
> >> was further on.
> >>
> >> johan
> >>
> >>
> >> Christian Essl wrote:
> >>
> >>> I do not know about ListView, but I think DataView and 
> >>> PagableDataView could be merged quite easaly.
> >>>
> >>> It already has the data-set size and the rows-count per 
> page. All we 
> >>> would need is to add a currentPage property and than we 
> just render 
> >>> from the startIndex+offsetOfPage.
> >>>
> >>> On bounding: I think we should strictly adhear to the 
> navigator for 
> >>> the current page property. If DataView is instructed to 
> show ie page 
> >>> 7 and there is nothing anymore on page 7 than it should just show 
> >>> nothing. The navigator should deal with that, it is the one who 
> >>> shows the current page-label. Especially DataView should 
> not do any 
> >>> more bounding than Math.max(0,settedPage). That is 
> because you can 
> >>> realy get some nasty bugs if a property value is set, than 
> >>> internally changed in the setMethod and than not 
> afterwards reread. 
> >>> Alternatively we should at least throw an IndexOutOfBoundsEx.
> >>>
> >>> I think I'll (try to) implement Igor's Grid example as a 
> Component 
> >>> after the IPageable is stable and DataView/PagabelDataView 
> >>> implements it. I guess before this it is just redundant work and 
> >>> there is the example which does with just one copy-paste 
> the job very well.
> >>>
> >>> Christian
> >>>
> >>> On Fri, 19 Aug 2005 09:28:27 -0700, Igor Vaynberg 
> >>> <[EMAIL PROTECTED]> wrote:
> >>>
> >>>> I really like the idea of having a listview that shows 
> everything 
> >>>> by default, and when you attach a pager to it it becomes 
> pageable. 
> >>>> So something like irangepageable { getrowsperpage() 
> >>>> setrowsperpage() getmaxrows() }But that's just me.
> >>>>
> >>>> Btw whats getmaxrows() is that getrowcount()?
> >>>>
> >>>> I don't see why the listview cannot have 
> setrowsperpage() anyways 
> >>>> which defaults to showing everything until used.
> >>>>
> >>>> -Igor
> >>>>
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: [EMAIL PROTECTED]
> >>>>> [mailto:[EMAIL PROTECTED] On Behalf Of 
> >>>>> Johan Compagner
> >>>>> Sent: Friday, August 19, 2005 2:29 AM
> >>>>> To: wicket-user@lists.sourceforge.net
> >>>>> Subject: Re: [Wicket-user] Re: ColumnedDataProvider startIndex 
> >>>>> problems
> >>>>>
> >>>>>
> >>>>> >
> >>>>> >> Alternatively we should make an PageableOrderedRepeatingView.
> >>>>> >>
> >>>>> >
> >>>>> > I want to wait for the new navigation to be done so we
> >>>>> don't need to
> >>>>> > have the regular - pageable pairs.
> >>>>> >
> >>>>> >
> >>>>>
> >>>>> I am currently inclined to keep this difference.
> >>>>>
> >>>>> Because now i have
> >>>>>
> >>>>> IPageable
> >>>>> {
> >>>>>     getCurrentPage();
> >>>>>     setCurrentPage(int);
> >>>>>     getPageCount();
> >>>>> }
> >>>>>
> >>>>> and i think i will make this one:
> >>>>>
> >>>>> IRangePageable extends IPageable
> >>>>> {
> >>>>>     getRowsPerPage();
> >>>>>     getMaxRows();
> >>>>> }
> >>>>>
> >>>>> instead of
> >>>>>
> >>>>> IRangePageable extends IPageable
> >>>>> {
> >>>>>     setRowsPerPage(int);
> >>>>>     getMaxRows();
> >>>>> }
> >>>>>
> >>>>> i think setting the number of rows a page should display is a 
> >>>>> property of the View that displays them Not something of the 
> >>>>> Navigation/Navigator that is attached to it..
> >>>>>
> >>>>> But if others are more in for pushing the rows per page 
> instead of 
> >>>>> pulling then i could change my mind.
> >>>>>
> >>>>> and ListView doesn't have to be a RangePageable it 
> could also be 
> >>>>> used to display a panel and that it is only a Pageable 
> So giving a 
> >>>>> listview by default the RangePageable interface is also wrong.
> >>>>> ListView could be directly an IPageable and PageableListView an 
> >>>>> IRangePageable.
> >>>>>
> >>>>> looks that logical?
> >>>>>
> >>>>> johan
> >>>>>
> >>>>>
> >>>>> johan
> >>>>>
> >>>>>
> >>>>>
> >>>>> -------------------------------------------------------
> >>>>> 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
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >> -------------------------------------------------------
> >> 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