in the custom component's constructor, why don't you do:
add(new IValidator() {
...
});
Or create a custom validator class and just add it to your custom
components.
On Tue, Feb 17, 2009 at 10:04 AM, walnutmon <[email protected]>wrote:
>
> All,
>
> I have custom components which know if they have a validation error when
> they call "updateModel()", the domain is where validation happens, I'm
> using
> this to post error messages which are rendered like a validation error:
>
> @Override
> public void updateModel()
> {
> try
> {
> super.updateModel();
> } catch (Exception ex)
> {
> error(ex.getCause().getMessage());
> }
> }
>
> however, unlike a wicket validation error, it still finishes the form
> submission, is there a way for a component to add a validation error, so
> that it behaves as if it were a MaximumLengthValidator() error, or
> something
> similar? Or do I need to extend IValidator, and pass it the component's
> domain object in order to do the check and use wicket's validation form
> processing procedure.
>
> Thanks!
> Justin
> --
> View this message in context:
> http://www.nabble.com/Validation-From-A-Custom-Component-tp22060300p22060300.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Jeremy Thomerson
http://www.wickettraining.com