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

[jsr372-experts] Re: [jsr372-experts mirror] Re: JSF_SPEC-1 Multi-field validation proposal

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Mon, 9 Nov 2015 22:51:45 +0100

Hi,

On Mon, Nov 9, 2015 at 10:32 PM, Edward Burns <edward.burns_at_oracle.com>
wrote:

> I wanted to share one additional point of feedback from my JavaOne
> co-speaker Lars Bilger at Lufthansa systems. Lars suggested we add an
> option to disable the copy and just populate the bean eagerly. This
> seems like a fine option to me.


That's a good suggestion indeed. If I understand the suggestion correctly
then this is what I implemented in OmniFaces as well using the
"validateMethod" attribute:

"validateMethod

Set the class level validation method, which can be either 'validateCopy'
or 'validateActual'.

If set to 'validateCopy', then it will perform the validation on a
copy/clone of the actual bean. This has the advantage that the validation
can be performed before the model is updated.

If set to 'validateActual', then it will perform the validation on the
actual bean instance. This has the disadvantage that the validation can
only be performed after the model is updated and thus the action method
will always be invoked regardless of the validation outcome.

Defaults to 'validateCopy'. This attribute is ignored when the 'value'
attribute is unspecified."

See: http://omnifaces.org/docs/vdldoc/2.1/o/validateBean.html#validateMethod

Kind regards,
Arjan Tijms