Hi Igor,
I created a BookmarkablePagingNavigationIncrementLink /
BookmarkablePagingNavigationLink as well as a BookmarkablePagingNavigation
(those three simply being the bookmarkable version of the ones already
existing in wicket-core).
The overridden methods therefore simply look like:
protected Link newPagingNavigationIncrementLink(String id, IPageable
pageable, int increment)
{
return new BookmarkablePagingNavigationIncrementLink(id, this.clazz,
pageable, this.params, increment);
}
protected Link newPagingNavigationLink(String id, IPageable pageable, int
pageNumber)
{
return new BookmarkablePagingNavigationLink(id, this.clazz,
pageable, this.params, pageNumber);
}
etc...
As the Bookmarkable links need a pageClass and pageParameters, I wanted to
pass them to my navigator's constructor. Problem being, if you extend from
Wicket's PagingNavigator, you cannot set pageParams and pageClass "before"
newPagingNavigationLink() etc.. gets called.
Finally, the gist :)
I simply didn't wanna duplicate PagingNavigator.java/.html if the only thing
I do is
this.params = params;
this.clazz = clazz;
before the PaginationLinks are called.
Puh,
Thanks again for reading :)
igor.vaynberg wrote:
>
> would you just override all the newPaging* factory methods?
>
> perhaps if you paste your code and what you cannot do i might help you
> more, right now i just dont see it :|
>
>
>
> -igor
>
>
> On Jan 14, 2008 12:03 PM, behlma <[EMAIL PROTECTED]> wrote:
>>
>> Hi Igor,
>> I created a BookmarkablePagingNavigator component. Its constructor takes
>> a
>> PageParameter object, that needs - of course - to be set *before*:
>>
>> add(newPagingNavigationLink("first", pageable, 0));
>> add(newPagingNavigationIncrementLink("prev", pageable,
>> -1));
>> add(newPagingNavigationIncrementLink("next", pageable, 1));
>> add(newPagingNavigationLink("last", pageable, -1));
>>
>> as they are all bookmarkable links.
>>
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > what exactly is the usecase?
>> >
>> > -igor
>> >
>> >
>> > On Jan 14, 2008 12:49 AM, behlma <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Not such a good idea, huh? :)
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> behlma wrote:
>> >> >
>> >> > Hi guys,
>> >> > would it be possible to change PagingNavigator's constructor from
>> >> >
>> >> > public PagingNavigator(final String id, final IPageable
>> pageable,
>> >> > final IPagingLabelProvider labelProvider)
>> >> > {
>> >> > super(id);
>> >> >
>> >> >
>> >> > // Get the navigation bar and add it to the hierarchy
>> >> > this.pagingNavigation = newNavigation(pageable,
>> >> labelProvider);
>> >> > add(pagingNavigation);
>> >> >
>> >> > // Add additional page links
>> >> > add(newPagingNavigationLink("first", pageable, 0));
>> >> > add(newPagingNavigationIncrementLink("prev", pageable,
>> >> -1));
>> >> > add(newPagingNavigationIncrementLink("next", pageable,
>> >> 1));
>> >> > add(newPagingNavigationLink("last", pageable, -1));
>> >> > }
>> >> >
>> >> > /**
>> >> >
>> >> >
>> >> > to
>> >> >
>> >> >
>> >> > public PagingNavigator(final String id, final IPageable pageable,
>> >> > final IPagingLabelProvider labelProvider)
>> >> > {
>> >> > super(id);
>> >> > initNavigator(pageable, labelProvider);
>> >> > }
>> >> >
>> >> >
>> >> > protected initNavigator(pageable, provider) {
>> >> > this.pagingNavigation = newNavigation(pageable,
>> >> labelProvider);
>> >> > add(pagingNavigation);
>> >> > ....
>> >> > }
>> >> >
>> >> >
>> >> > I'm asking because I subclassed PagingNavigator and I have
>> additional
>> >> > constructor parameters I want to pass to the constructor "before"
>> >> invoking
>> >> > "initNavigator".
>> >> >
>> >> >
>> >> > Thanks for your time!
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/PagingNavigator-refactoring-request-tp14783646p14797267.html
>> >>
>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/PagingNavigator-refactoring-request-tp14783646p14812182.html
>>
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/PagingNavigator-refactoring-request-tp14783646p14817983.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]