You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Lowery <sl...@gatessolutions.com> on 2011/03/22 21:58:36 UTC

validation with link only

I have a Form object whose only child is an AjaxSubmitLink.  The Form's
onSubmit() calls to a service to delete its model object (from the
underlying database).  I would like to add validation to make sure that the
model can be deleted (i.e. there are no foreign keys referencing it) before
attempting to do it.  I thought I could achieve this with an
AbstractFormValidator, but if I detect the error in the validate() method,
all of the error methods on AbstractFormValidator expect a FormComponent,
which I don't have.

What is the best way to accomplish validating a Form that does not have a
FormComponent?

Re: validation with link only

Posted by James Carman <ja...@carmanconsulting.com>.
Why do you need a form?  Just use an AjaxLink.  And, do the check in
the onClick() method.

On Tue, Mar 22, 2011 at 4:58 PM, Steve Lowery
<sl...@gatessolutions.com> wrote:
> I have a Form object whose only child is an AjaxSubmitLink.  The Form's
> onSubmit() calls to a service to delete its model object (from the
> underlying database).  I would like to add validation to make sure that the
> model can be deleted (i.e. there are no foreign keys referencing it) before
> attempting to do it.  I thought I could achieve this with an
> AbstractFormValidator, but if I detect the error in the validate() method,
> all of the error methods on AbstractFormValidator expect a FormComponent,
> which I don't have.
>
> What is the best way to accomplish validating a Form that does not have a
> FormComponent?
>

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