Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune
Sooo...getAjaxCallDecorator() is in AjaxPagingNavigationBehavior, which is constructed in AjaxPagingNavigationLink, which is constructed in AjaxPagingNavigator.newPagingNavigatorLink(), which my subclass overrides. Is there a way to add this decorator without having to pass an object up the

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
Is this not possible for you: protected Link newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { return new AjaxPagingNavigationLink(id, pageable, pageNumber) { @Override protected

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune
I misspoke a earlier, the method I need to override is newPagingNavigationIncrementLink(). Looks like this: public AjaxPagingNavigationIncrementLink(final String id, final IPageable pageable, final int increment) { super(id, pageable, increment);

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
Yeah, I see what you mean. The AjaxPagingNavigationIncrementLink is not really an AjaxLink, but has had an AjaxBehavior grafted in. I think your best bet would be to build a PagingNavigationIncrementLink and add a behavior similar to AjaxPagingNavigationBehavior to it, but with the scriptaculous

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune
Well, that works...I think this would be made easier if there were a getAjaxBehavior() method in AjaxPagingNavigationIncrementLink. As it stands, there are a few methods in my class that were copied/pasted directly from AjaxPagingNavigationLink: public class

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune
Scratch that, the solution below causes a page refresh... getAjaxCallDecorator() returns new CancelEventIfNoAjaxDecorator() it works fine, but if it returns the defined decorator, the page refreshes after the ajax call is complete. Why would that be? Should decorator extend

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
From what I can tell, since it is not really an ajax link but rather a regular link with an ajax behavior, the ajax behavior needs to prevent the onclick from bubbling to the anchors clickhandler. Your ajaxcalldecorator will need to do that as well. It would be great if once you are done you could

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune
Fixed this last bit by wrapping the return call decorator in a CancelEvent one (it chains): final AjaxPagingNavigationBehavior behavior = new AjaxPagingNavigationBehavior(this, pageable, onclick) { protected IAjaxCallDecorator getAjaxCallDecorator() { return new

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune
I doubt I've enhanced anything. This is a rather roundabout solution at best...You mean edit the Wicket source and post it somewhere? James McLaughlin-3 wrote: From what I can tell, since it is not really an ajax link but rather a regular link with an ajax behavior, the ajax behavior needs

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
Well, it should be much easier to get the AjaxBehavior that is making the PagingNavigatorLink act like an ajax link, so you can decorate the onclick in the manner you suggested. You can create a jira issue here http://issues.apache.org/jira/browse/WICKET Describe your problem, what would make an

[Wicket-user] Adding more onclick script to ajax link?

2007-05-30 Thread Tremelune
I'm looking to add an additional script to the onclick of a (paging) ajax link. I stumbled on this thread: http://www.nabble.com/Appending-to-AJAX-Submit-Button-onclick-tf1695285.html#a4600751 I can't seem to find the additional code in 1.3. The thread is a year old, perhaps the code was