You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thies Edeling <th...@rrm.net> on 2008/01/24 22:57:41 UTC

Multiple AjaxFormSubmitBehavior's on the same form

Hi all,

I have a Form which gets submitted by an AjaxButton. Validation of the 
FormComponents is triggered by AjaxFormValidationBehavior.
Both add an AjaxFormSubmitBehavior to the form which bite eachother a 
bit. When the form is submitted by the AjaxButton the
AjaxFormValidationBehavior is invoked as well, trying to add the 
FeedbackPanels to the AjaxRequestTarget. This fails because the
form is already replaced on the clientside by the AjaxButton and I end 
up with a javascript error.

I fixed it by manually triggering the validation from an 
AjaxFormComponentUpdatingBehavior but I thought using a 
AjaxFormValidationBehavior and an AjaxButton together is common practice?

gr
Thies




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multiple AjaxFormSubmitBehavior's on the same form

Posted by Thies Edeling <th...@rrm.net>.
Thanks! I missed the first javadoc part in the AjaxFormValidationBehavior:

//Ajax event behavior that submits the form ////and updates all form feedback panels on the page.////

//gr
Thies//
//


Michael Sparer wrote:
> If your form has an AjaxFormSubmitBehavior you don't need AjaxButtons to
> submit it, regular buttons are sufficient (they don't even have to be
> controlled by wicket). If you'd like to add an additional Ajaxbutton that
> does its own stuff (i.e. you don't want it to submit the form) you can
> setDefaultFormProcessing to false
>
> hope that helps
>
> Michael
>
> Thies Edeling wrote:
>   
>> Hi all,
>>
>> I have a Form which gets submitted by an AjaxButton. Validation of the 
>> FormComponents is triggered by AjaxFormValidationBehavior.
>> Both add an AjaxFormSubmitBehavior to the form which bite eachother a 
>> bit. When the form is submitted by the AjaxButton the
>> AjaxFormValidationBehavior is invoked as well, trying to add the 
>> FeedbackPanels to the AjaxRequestTarget. This fails because the
>> form is already replaced on the clientside by the AjaxButton and I end 
>> up with a javascript error.
>>
>> I fixed it by manually triggering the validation from an 
>> AjaxFormComponentUpdatingBehavior but I thought using a 
>> AjaxFormValidationBehavior and an AjaxButton together is common practice?
>>
>> gr
>> Thies
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>>     
>
>
> -----
> Michael Sparer
> http://talk-on-tech.blogspot.com
>   


-- 
http://www.ehour.nl/ 
http://blog.ehour.nl/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Multiple AjaxFormSubmitBehavior's on the same form

Posted by Michael Sparer <mi...@gmx.at>.
If your form has an AjaxFormSubmitBehavior you don't need AjaxButtons to
submit it, regular buttons are sufficient (they don't even have to be
controlled by wicket). If you'd like to add an additional Ajaxbutton that
does its own stuff (i.e. you don't want it to submit the form) you can
setDefaultFormProcessing to false

hope that helps

Michael

Thies Edeling wrote:
> 
> Hi all,
> 
> I have a Form which gets submitted by an AjaxButton. Validation of the 
> FormComponents is triggered by AjaxFormValidationBehavior.
> Both add an AjaxFormSubmitBehavior to the form which bite eachother a 
> bit. When the form is submitted by the AjaxButton the
> AjaxFormValidationBehavior is invoked as well, trying to add the 
> FeedbackPanels to the AjaxRequestTarget. This fails because the
> form is already replaced on the clientside by the AjaxButton and I end 
> up with a javascript error.
> 
> I fixed it by manually triggering the validation from an 
> AjaxFormComponentUpdatingBehavior but I thought using a 
> AjaxFormValidationBehavior and an AjaxButton together is common practice?
> 
> gr
> Thies
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 


-----
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: http://www.nabble.com/Multiple-AjaxFormSubmitBehavior%27s-on-the-same-form-tp15076042p15083091.html
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