You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Cédric Durmont <cd...@gmail.com> on 2012/01/27 15:02:39 UTC

[ExtVal] Validations for one action only

Hello there,

I'm trying to implement a somewhat classical validation scheme : I
have a JSF form ( Myfaces 2.1.5, Trinidad 2.0.2-SNAPSHOT), and I want
to perform some validations but only when I trigger a specific button
/ action.
Other buttons in the page may open dialogs, trigger actionEvents /
valueChangeEvents. There are also some autosubmit input fields
(Trinidad), and I need all these to run without being stopped by the
validation.

I tried to simply use immediate="true" on every button / field where
it was needed, but strangely enough, it didn't stop all of the
validations (esp. the input fields with autosubmit + immediate="true"
act as if they were immediate="false".

Can some folks here give me a hint on the best way to achieve this ?
My validations a a mix on static (this field is numeric, this one's 50
chrs max, etc.) and dynamic ("if value of attribute A is in a specific
list, then B becomes mandatory", "X or Y may be null, but not both")
Getting these to work with Trinidad's client-based validations would
definitely be the icing on the cake !

Thanks,

Cedric Durmont

Re: [ExtVal] Validations for one action only

Posted by Gerhard Petracek <ge...@gmail.com>.
hi cedric,

you can have a look at [1].

@client-side validation:
you can use component initialization to get the corresponding
information to the browser.

regards,
gerhard

[1] http://s.apache.org/sLW

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2012/1/27 Cédric Durmont <cd...@gmail.com>:
> Hello there,
>
> I'm trying to implement a somewhat classical validation scheme : I
> have a JSF form ( Myfaces 2.1.5, Trinidad 2.0.2-SNAPSHOT), and I want
> to perform some validations but only when I trigger a specific button
> / action.
> Other buttons in the page may open dialogs, trigger actionEvents /
> valueChangeEvents. There are also some autosubmit input fields
> (Trinidad), and I need all these to run without being stopped by the
> validation.
>
> I tried to simply use immediate="true" on every button / field where
> it was needed, but strangely enough, it didn't stop all of the
> validations (esp. the input fields with autosubmit + immediate="true"
> act as if they were immediate="false".
>
> Can some folks here give me a hint on the best way to achieve this ?
> My validations a a mix on static (this field is numeric, this one's 50
> chrs max, etc.) and dynamic ("if value of attribute A is in a specific
> list, then B becomes mandatory", "X or Y may be null, but not both")
> Getting these to work with Trinidad's client-based validations would
> definitely be the icing on the cake !
>
> Thanks,
>
> Cedric Durmont