I worked it out. Very simple solution! On the AjaxSubmitLink override the onError method and add the feedback panel to the AjaxRequestTarget !
Ian ----- Original Message ---- From: Gerolf Seitz <[EMAIL PROTECTED]> To: [email protected] Sent: Sunday, 26 August, 2007 6:05:00 PM Subject: Re: AJAX form submit and validation have you tried AjaxFormComponentUpdatingBehavior? gerolf On 8/26/07, Ian Godman <[EMAIL PROTECTED]> wrote: > > Thanks but this does not solve my problem. > > I am submitting the form via ajax using an AjaxSubmitLink. If the form has > errors on it then I do not get the submit, if the form has no errors then > the submit code runs ok. The errors are not displayed. > > If I add a AjaxFormValidatingBehavior for the onblur event then I can see > the errors but they check for required fields etc as soon as the first field > is left therefore displaying errors too soon. > > With the AjaxFormValidatingBehavior set to onsubmit event I get no error > reporting and no submit. > > I need to validate the entire form only when submit button is pressed > pressed. One possibility is to do the validation "by hand" in the submit > processing code. > > > Ian > > > ----- Original Message ---- > From: Gerolf Seitz <[EMAIL PROTECTED]> > To: [email protected] > Sent: Sunday, 26 August, 2007 2:10:01 PM > Subject: Re: AJAX form submit and validation > > concerning "one field depends on another": > have you already taken a look at > > http://cwiki.apache.org/confluence/display/WICKET/Validating+related+fields > ? > the code is still 1.2, but it should get you started. > > hth, > gerolf > > On 8/26/07, Ian Godman <[EMAIL PROTECTED]> wrote: > > > > Hi > > > > I have a form that is submitted by ajax. > > > > I have validation on fields of the form. > > > > Using AjaxFormValidatingBehavior the form will be validated and error > > messages displayed when the onblur event is used. > > > > However this is not what I need as the validation of one field depends > on > > another. I have tried to set the AjaxFormValidatingBehavior to onsubmit > but > > it appears that if the form is invalid then its not submitted so no > errors > > are displayed. > > > > Is there any way I can validate my form using ajax only when it is > > submited ? > > > > > > Ian > > > > > > > > > > ___________________________________________________________ > > Yahoo! Answers - Got a question? Someone out there knows the answer. Try > > it > > now. > > http://uk.answers.yahoo.com/ > > > > > > > > ___________________________________________________________ > Want ideas for reducing your carbon footprint? Visit Yahoo! For Good > http://uk.promotions.yahoo.com/forgood/environment.html ___________________________________________________________ 24 FIFA World Cup tickets to be won with Yahoo! Mail http://uk.mail.yahoo.com
