In your solution I have to have a "first" link in my navigator markup
(HTML). But I don't want to have such link at all (even is pageNumber
is > 0).
And what about this condition in PagingNavigator.onBeforeRender(), why
not "!hasBeenRendered()"?
--
Daniel
On Thu, May 29, 2008 at 6:59 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> class mypager extends pagingnavigator {
> newPagingNavigationLink(String id, IPageable pageable, int pageNumber) {
> Link l=super.newPagingNavigationLink(...);
> if (pageNumber<1) {
> l.setvisible(false);
> }
> return l;
> }
> }
>
> -igor
>
> On Thu, May 29, 2008 at 5:49 AM, Daniel Stoch <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I've just made an upgrade to 1.3-SNAPSHOT. And now I have a problem
>> with customizing PagingNavigator component, because of moving creation
>> of components to onBeforeRender() method.
>> In out navigator we want to hide (remove) some links (eg. first and
>> last). So I have a constructor like this:
>>
>> public FooterPagingNavigator(String id, IPageable pageable) {
>> super(id, pageable);
>> remove("first");
>> remove("last");
>> }
>>
>> Now the exception is thrown because these links are added in
>> onBeforeRender(). So I can change our component and move code from
>> constructor to onBeforeRender(), but now in this method in
>> PagingNavigator there is a condition:
>>
>> if (get("first") == null)
>> {
>> ...
>> }
>>
>> So each time I remove "first" component the code inside condition will
>> be called - so exception will be thrown then.
>> The question is why this condition is in such form:
>>
>> if (get("first") == null)
>>
>> and no like this:
>>
>> if (!hasBeenRendered())
>>
>> ?
>> Then I will be able to remove components using the same condition.
>>
>> --
>> Daniel
>>
>> ---------------------------------------------------------------------
>> 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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]