On Fri, Feb 24, 2012 at 2:18 PM, gmparker2000 <greg.par...@brovada.com> wrote: > Hmm more problems. This is definitely turning out to be more difficult than > I expected. If a component already has an Ajax behavior added, then my > behavior conflicts. Either my behavior is used and the original behavior is > affected, or vice versa. For example if I try to do this: > > public class MyAjaxButton extends AjaxButton {
Don't extend from AjaxButton at all. You are actually re-implementing it ... > public MyAjaxButton(String id) { > super(id); > > this.add(new AjaxFormSubmitBehavior("onclick") { > @Override > public CharSequence getCallbackUrl(boolean onlyTargetActivePage) > { > return super.getCallbackUrl(onlyTargetActivePage) + > "&cID=2"; > } > > @Override > protected void onSubmit(AjaxRequestTarget target) { > } > > @Override > protected void onError(AjaxRequestTarget target) { > } > }); > } > ... > > my behavior interferes with the onclick AjaxFormSubmitBehavior that the > AjaxButton already has added (also tried with AjaxEventBehavior). I guess > it makes sense that if there is already a behavior attached to onclick that > adding another one is not a great idea. > > I've tried a couple of other approaches such as removing the existing > behavior, adding my own, and delegating to the original behavior to preserve > its functionality but this doesn't work because the behavior's methods are > protected. > > The other problem is that controls such as in-method datagrid already > override getCallbackUrl to add their own parameters. In cases like this > there seems to be no way I can let the datagrid add a parameter and then add > more. > > Any help is appreciated. Maybe there is an entirely different approach. > > > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Adding-extra-request-parameters-to-AJAX-calls-tp4405842p4417142.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org