What you have should work - but its always going to give an error unless
statut is set to "Doctorant".

Are you sure "statut" is in your bean and getting populated?

Niall

----- Original Message ----- 
From: "Emmanuel.Leguy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Tuesday, September 27, 2005 6:46 PM
Subject: ValidWhen and string comparison


> Hello,
>
> I try to use the validator with validwhen. I want to use a string
> comparison but it fails. I use struts 1.2.7 and here is my validators.xml:
>
> <!DOCTYPE form-validation PUBLIC
>           "-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.1.3//EN"
>           "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>
> <form-validation>
>     <formset>
>         <form name="finSaisie">
>               <field property="financement" depends="validwhen">
>                   <arg0 key="gwiad.libelle.financement"/>
>                 <var>
>                       <var-name>test</var-name>
>                       <var-value>(statut == "Doctorant")</var-value>
>                 </var>
>               </field>
>         </form>
>     </formset>
> </form-validation>
>
> I gess it means that the field 'financement' is valid when the field
> 'statut' is "Doctorant". But it is never valid...
> I tested with success integer comparison and the null comparison but I
> can't use string comparison. But the struts documentation tells it is
> possible and some users in this mailing list use string comparison with
> success.
>
> So what can I do?
>
> Thanx,
>
> Manu.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to