cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <>
Subject Re: WidgetValidators: do they need FormContext?
Date Tue, 27 Apr 2004 11:21:36 GMT

Bruno Dumon wrote:

> I was just looking at adding widget validators on widget instances and
> found it's already there. Cool :-)
> Still a question about the WidgetValidator interface:
> public interface WidgetValidator {
>     boolean validate(Widget widget, FormContext context);
> }
> will a validator ever need the FormContext object?

I had the same question popin' up when looking at validate(FormContext) 
on widget.. only thing I could imagine was that it might be useful to 
have access to the Locale?

And I would need to take a deeper look but probably one could (today) 
obtain the same through widget.getFormDefinition().getLocale()

this assumes that validation is called after readFromRequest() (no pro) 
but would also assume that if validation needs to happen after binding 
(doesn't ATM) this locale on form should be set

Marc Portier                  
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                          

View raw message