AjaxPagingNavigator and IndicatingAjaxLink
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]
Re: AjaxPagingNavigator and IndicatingAjaxLink
Op woensdag 08-10-2008 om 02:56 uur [tijdzone -0700], schreef Michael Sparer: 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 ... Thanks, that worked. However I'm now trying to figure out how to make the indicator be displayed next to the navigator, instead of below. In other words, how to make the indicator's span tag appear inside of the div instead of outside it. regards, -- Reinout van Schouwen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AjaxPagingNavigator and IndicatingAjaxLink
alright, but that's more CSS fiddling than wicket related have fun tweaking your styles ;-) regards, Michael Reinout van Schouwen-4 wrote: Op woensdag 08-10-2008 om 02:56 uur [tijdzone -0700], schreef Michael Sparer: 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 ... Thanks, that worked. However I'm now trying to figure out how to make the indicator be displayed next to the navigator, instead of below. In other words, how to make the indicator's tag appear inside of the div instead of outside it. 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-tp19875656p19876572.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: AjaxPagingNavigator and IndicatingAjaxLink
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]