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 elegant solution, and mark
it as an enhancement.

best,
jim

On 5/31/07, Tremelune <[EMAIL PROTECTED]> wrote:
>
> 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 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 create an rfe in jira with the
> > enhancements that will make this process easier.
> >
> > jim
> >
> > On 5/31/07, Tremelune <[EMAIL PROTECTED]> wrote:
> >>
> >> 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
> >> CancelEventIfNoAjaxDecorator??
> >>
> >>
> >>
> >>
> >> Tremelune wrote:
> >> >
> >> > 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 DecoratableAjaxPagingNavigationIncrementLink extends
> >> > PagingNavigationIncrementLink
> >> >     implements IAjaxLink {
> >> >
> >> >   public DecoratableAjaxPagingNavigationIncrementLink(final String id,
> >> > final IPageable pageable,
> >> >                                                       final int
> >> increment)
> >> > {
> >> >     super(id, pageable, increment);
> >> >
> >> >     //Adds more text to onclick attribute
> >> >     final AjaxCallDecorator decorator = new AjaxCallDecorator() {
> >> >       public CharSequence decorateScript(final CharSequence
> >> charSequence)
> >> > {
> >> >         CharSequence ajaxCall = super.decorateScript(charSequence);
> >> >         return ajaxCall + "more onclick stuff";
> >> >       }
> >> >     };
> >> >
> >> >     //Adds onclick attribute
> >> >     final AjaxPagingNavigationBehavior behavior =
> >> >         new AjaxPagingNavigationBehavior(this, pageable, "onclick") {
> >> >           protected IAjaxCallDecorator getAjaxCallDecorator() {
> >> >             return decorator;
> >> >           }
> >> >         };
> >> >
> >> >     //The rest of this class is direct from AjaxPagingNavigatorLink
> >> >
> >> >     add(behavior);
> >> >     setOutputMarkupId(true);
> >> >   }
> >> >
> >> >
> >> >   protected String getEventHandler(String defaultHandler) {
> >> >     return defaultHandler;
> >> >   }
> >> >
> >> >   public void onClick() {
> >> >     onClick(null);
> >> >     setRedirect(false);
> >> >     setResponsePage(getPage());
> >> >   }
> >> >
> >> >   public void onClick(AjaxRequestTarget target) {
> >> >     pageable.setCurrentPage(getPageNumber());
> >> >   }
> >> > }
> >> >
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901080
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> -------------------------------------------------------------------------
> >> This SF.net email is sponsored by DB2 Express
> >> Download DB2 Express C - the FREE version of DB2 express and take
> >> control of your XML. No limits. Just data. Click to get it now.
> >> http://sourceforge.net/powerbar/db2/
> >> _______________________________________________
> >> Wicket-user mailing list
> >> Wicket-user@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901775
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to