why not just let your IndicatingPagingNavigator implement IAjaxIndicatorAware
- then you got your feedback and also have it at one place (only one
indicator) instead of multiple indicators as each ajaxlink would have its
own ...

e.g.
public class IndicatingAjaxPagingNavigator extends AjaxPagingNavigator
implements IAjaxIndicatorAware {
    private final WicketAjaxIndicatorAppender _indicatorAppender = new
WicketAjaxIndicatorAppender();

    public IndicatingAjaxPagingNavigator(String id, /* snip */) {
       super(id, /* snip */);
       add(_indicatorAppender);
       // snip
    }

        public String getAjaxIndicatorMarkupId() {
                return _indicatorAppender.getMarkupId();
        }
}

regards,
Michael

Reinout van Schouwen-4 wrote:
> 
> Hi all,
> 
> I tried extending the AjaxPagingNavigator class to provide some feedback
> while loading the next page using IndicatingAjaxLink. The
> (not-compiling) code I wrote is below. I couldn't make it work because
> the protected methods in AjaxPagingNavigator return a Link, as AjaxLink
> is a sibling of Link instead of a subclass.
> 
> Why doesn't the AjaxPagingNavigator use an AjaxLink in the first place?
> 
> Suggestions welcome.
> 
> 
> /* this doesn't work because IndicatingAjaxLink is not a subclass of Link
>      class IndicatingAjaxPagingNavigator extends AjaxPagingNavigator {
> 
>         public IndicatingAjaxPagingNavigator(String id, IPageable
> pageable) {
>             super(id, pageable);
>         }
>         
>         @Override
>         protected Link newPagingNavigationLink(String id, IPageable
> pageable, int pageNumber) {
>             final Link result = super.newPagingNavigationIncrementLink(id,
> pageable, pageNumber);
>             
>             return new IndicatingAjaxLink(id) {
> 
>                 @Override
>                 public void onClick(AjaxRequestTarget target) {
>                     result.onClick();
>                 }
>             };
>         }
>     } 
> */
> 
> regards,
> 
> -- 
> Reinout van Schouwen
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-----
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/AjaxPagingNavigator-and-IndicatingAjaxLink-tp19875656p19875773.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]

Reply via email to