jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] [multi component validation]

From: Michael Müller <michael.mueller_at_mueller-bruehl.de>
Date: Sat, 28 Mar 2015 22:08:20 +0100

Hi,

When talking about multicomponent validation, I personally misunderstood
the intention of this.

During a short EG face to face meeting, we talked about some examples,
to clarify its intention:

A couple of components might relate to each other. Even though each of
these components got a valid value, the combination of values might be
false.

Examples:
- A bank account number and a bank location number must fit together,
validated by a checksum rule.

- two fields, e.g. person's age and birthdate might suspend each other

- A component might be repeated, e.g. password or email. Not only each
of them must be valid, both must contain the same value

To achieve multi component validation, it is not possible to convert and
validate component by component. In fact, the conversation and
validation phase has to be splitted internally: All components have to
be converted and the the validation is started then. We agreed to
support the bean validation groups.

I like to add some thoughts:

- It would be nice to hook in the middle of this conversation and
validation phase, e.g. by a PostConversationEvent

- Beside bean validation, it should be possible to define a validator
the "JSF way". And it would be nice to support actions depending on the
validation result, e.g delete or change the content of one or more
components.

Is my understanding right?


-- 
Herzliche Grüße - Best Regards,
Michael Müller
Read my book "Web Development with Java and JSF": https://leanpub.com/jsf