You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by NateBot2000 <bi...@nathanbeach.com> on 2007/09/19 17:43:35 UTC
Custom AjaxFormSubmitBehavior
Howdy:
I created an extension of AjaxSubmitLink that accepts a static html form id
string as an argument (AjaxFormSubmitBehavior forces setOutputMarkupId on
the Form by default). In so doing, I extended AjaxFormSubmitBehavior... and
then I add this custom behavior to my custom AjaxSubmitLink.
My question is: what is the proper way of removing / overriding the old
AjaxFormSubmitBehavior that's added by the parent class? I am currently
doing a MarkupContainer.removeAll() on the link before I add my custom
behavior (this seems to work fine), but that seems wrong and potentially
dangerous.
Thanks for any help...
NateBot2000
--
View this message in context: http://www.nabble.com/Custom-AjaxFormSubmitBehavior-tf4481784.html#a12780167
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Custom AjaxFormSubmitBehavior
Posted by Kent Tong <ke...@cpttm.org.mo>.
NateBot2000 wrote:
>
> I created an extension of AjaxSubmitLink that accepts a static html form
> id string as an argument (AjaxFormSubmitBehavior forces setOutputMarkupId
> on the Form by default). In so doing, I extended
> AjaxFormSubmitBehavior... and then I add this custom behavior to my custom
> AjaxSubmitLink.
>
> My question is: what is the proper way of removing / overriding the old
> AjaxFormSubmitBehavior that's added by the parent class? I am currently
> doing a MarkupContainer.removeAll() on the link before I add my custom
> behavior (this seems to work fine), but that seems wrong and potentially
> dangerous.
>
Why not just extend AbstractSubmitLink and add your behavior to it?
--
View this message in context: http://www.nabble.com/Custom-AjaxFormSubmitBehavior-tf4481784.html#a12833535
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Custom AjaxFormSubmitBehavior
Posted by NateBot2000 <bi...@nathanbeach.com>.
Oh, I just looked closer at Component.getBehaviors and see what to do.
Sorry...
I guess something along the lines of this would work?
List<IBehavior> list = this.getBehaviors(
Class.forName("AjaxFormSubmitBehavior") );
for ( IBehavior b : list )
{
this.remove(b);
}
NateBot
--
View this message in context: http://www.nabble.com/Custom-AjaxFormSubmitBehavior-tf4481784.html#a12780424
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org