Hi Jeremy,
I did something similar to what you have suggested and it works just fine.
The difference is that I had to use a Navigation as well.
If I try overriding newPagingNavigationLink in my Paging*Navigator*, the
before and after markups are not added.
Instead, I also created a class that inherits Paging*Navigation* and in that
class I overridden the newPagingNavigationLink method.
And in my *Navigator*, I have overridden newNavigation that returns my
styled *Navigation*.

Any remarks about this?

On Sat, May 17, 2008 at 4:44 PM, Jeremy Thomerson <[EMAIL PROTECTED]>
wrote:

> Looking at the super.newPagingNavigationLink implementation, you could
> actually do this to address the handling first / last pages differently:
>
>        new PagingNavigator(null, null) {
>
>            private static final long serialVersionUID = 1L;
>
>             @Override
>            protected Link newPagingNavigationLink(String id, IPageable
> pageable, int pageNumber) {
>                 PagingNavigationLink link = (PagingNavigationLink)
> super.newPagingNavigationLink(id, pageable, pageNumber);
>                link.setBeforeDisabledLink("<my markup>");
>                link.setAfterDisabledLink("<my markup>");
>                 if (link.isLast()) {
>                    // do something
>                }
>                if (link.isFirst()) {
>                    // do something
>                 }
>                return link;
>
>            }
>
>        };
>
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> On Sat, May 17, 2008 at 8:41 AM, Jeremy Thomerson <
> [EMAIL PROTECTED]>
> wrote:
>
> > As far as the <em>, just call
> > setAfterDisabledLink(final String afterDisabledLink)
> > and
> > setBeforeDisabledLink(final String beforeDisabledLink)
> > to override the markup for a disabled link.
> >
> > Do it like this inside your overridden PagingNavigator:
> >
> >         new PagingNavigator(null, null) {
> >
> >             private static final long serialVersionUID = 1L;
> >             // this is the important part:
> >             @Override
> >             protected Link newPagingNavigationLink(String id, IPageable
> > pageable, int pageNumber) {
> >                 Link link = super.newPagingNavigationLink(id, pageable,
> > pageNumber);
> >                 link.setBeforeDisabledLink("<my markup>");
> >                 link.setAfterDisabledLink("<my markup>");
> >                 return link;
> >
> >             }
> >
> >         };
> >
> >
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> > On Sat, May 17, 2008 at 5:52 AM, Mathias P.W Nilsson <
> [EMAIL PROTECTED]>
> > wrote:
> >
> >>
> >> Hi!
> >>
> >> I have subclassed PagingNavigator to delete the last and first element
> of
> >> the pager. Now I need some way of setVisible( false ) on prev and next
> if
> >> it
> >> is the first or last page. How can this be done.
> >>
> >> Altso. the current page is renderered <em>. Is it possible to have a
> >> current_page or something like that?
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17290391.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]
> >>
> >>
> >
> >
>



-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/

Reply via email to