Re: Controlling PagingNavigation

2008-05-19 Thread Mathias P.W Nilsson

Thanks again Igor. 
-- 
View this message in context: 
http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17330923.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]



Re: Controlling PagingNavigation

2008-05-19 Thread Igor Vaynberg
why is this so hard?

class mypagingnavigator extends pagingnavigator {
  protected Link newPagingNavigationIncrementLink(... final
pageable, final increment {
  return new PagingNavigationIncrementLink(id, pageable, increment) {
isvisible() {
  if (increment==-1) {
 return pageable.getcurrentpage()>0;
  } else {
  return pageable.getcurrentpage() wrote:
>
> I still can't find a way to hide the prev and/or the next on a certain
> condition.
>
> If the first page is showed I want to hide the prev. And if there are no
> more pages I want to hide the next. Anyone that has done this?
> --
> View this message in context: 
> http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17330081.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]



Re: Controlling PagingNavigation

2008-05-19 Thread Mathias P.W Nilsson

I still can't find a way to hide the prev and/or the next on a certain
condition.

If the first page is showed I want to hide the prev. And if there are no
more pages I want to hide the next. Anyone that has done this?
-- 
View this message in context: 
http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17330081.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]



Re: Controlling PagingNavigation

2008-05-18 Thread Mathias P.W Nilsson

 I want to HIDE the prev, next if the first or last is selected.
-- 
View this message in context: 
http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17301483.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]



Re: Controlling PagingNavigation

2008-05-18 Thread Eyal Golan
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("");
>link.setAfterDisabledLink("");
> 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 , 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("");
> > link.setAfterDisabledLink("");
> > 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 . 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/


Re: Controlling PagingNavigation

2008-05-18 Thread Mathias P.W Nilsson

Thanks alot! This just hides the first and last link. I want to add the prev,
next if the first or last is selected. 
-- 
View this message in context: 
http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17300634.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]



Re: Controlling PagingNavigation

2008-05-17 Thread Jeremy Thomerson
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("");
link.setAfterDisabledLink("");
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 , 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("");
> link.setAfterDisabledLink("");
> 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 . 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]
>>
>>
>
>


Re: Controlling PagingNavigation

2008-05-17 Thread Jeremy Thomerson
As far as the , 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("");
link.setAfterDisabledLink("");
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 . 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]
>
>


Controlling PagingNavigation

2008-05-17 Thread Mathias P.W Nilsson

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