Hi Dan

On Mon, Apr 19, 2010 at 2:04 PM, Dan Haywood <[email protected]> wrote:

>  Another form-related question.
>
> I can see how to install a validator on a Form - Form#add(IFormValidator) -
> but it seems that AbstractFormValidator, the adapter, always requires a
> specific FormComponent to be specified in its error(...) method.
>
> How does one raise an error on the state of the form (and by implication,
> that of the underlying domain object) itself, without having to specify any
> form component?
>
>
FeedbackMessages API, is expection an Component object as reporter. Maybe
add the validation error to the form component will make sense:

formComponent.getForm().error( theValidationErrorNotFormComponentSpecific )

An example would be the classic fromDate < endDate.  A workaround would be
> to install the validator on - say - the endDate.  But I'm after a general
> solution, rather than a solution for this particular example.
>
> Thanks
> Dan
>
>
> --
> Dan Haywood   consultant, mentor, developer, author   agile, ddd, oo,
> java, .net, sybase   MA, MBCS, CITP, CEng   *mail: *
> [email protected]   *phone: *+44 (0)7961 144286   *book: *Domain
> Driven Design using Naked Objects <http://pragprog.com/titles/dhnako>   *blog:
> *http://danhaywood.com   *linked in: *http://uk.linkedin.com/in/dkhaywood
> *twitter: *http://twitter.com/dkhaywood   *sybase: *
> http://sybtraining.co.uk
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>



-- 
Pedro Henrique Oliveira dos Santos

Reply via email to