You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by georgehill <ge...@xymail.net> on 2003/08/07 05:34:35 UTC

how to use requiredif

Hi all,
 
I hava question about the use of required in the validation.xml file.My example is :
      <field property="conPassword" depends="requiredif">
        <arg0 key="prompt.confirm.password"/>
        <var>
          <var-name>test</var-name>
          <var-value>((newPassword != null)</var-value>
        </var>
      </field>
Is it right? If it's wrong, please give me a right example.
Thanks a lot. :)


RE: how to use requiredif

Posted by Yansheng Lin <ya...@isogis.com>.
Same sentiment here.

Where is the list of complete variable properties the the var element uses to
pass to the validator?

I was so confused that field-test[0] and fieldTest[0] both seemed to be valid
properties, until I read a tutorial by James Tuner that "Change was made between
Beta 1 and RC1, variable names are now camelCase rather than dashed."

It's so hard to find this kind of things if there are not on the Struts
dev-guide page.   

-----Original Message-----
From: George Hill [mailto:georgehill@xymail.net] 
Sent: August 8, 2003 12:12 AM
To: Struts Users Mailing List; alex@law.columbia.edu
Subject: Re: how to use requiredif


thank you. i understand it. can you tell me where can i find all the validator
document? i have searched the struts 1.1 document, but find a little.
----- Original Message ----- 
From: "Alex Shneyderman" <al...@law.columbia.edu>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, August 07, 2003 7:11 PM
Subject: RE: how to use requiredif


> <field property="phone" depends="requiredif">
> <arg0 key="venue.phone" />
> <var>
> <var-name>field[0]</var-name>
> <var-value>venueId</var-value>
> </var>
> <var>
> 
> <var-name>field-test[0]</var-name>
> <var-value>EQUAL</var-value>
> </var> 
> <var>
> 
> <var-name>field-value[0]</var-name>
> <var-value>0</var-value>
> </var> 
> </field>
> 
> here is an example where phone is required if venueId is EQUAL to 0.
> There are couple of other options for the kind of test just look it up
> in FiledsCheck validator.
> 
> > -----Original Message-----
> > From: georgehill [mailto:georgehill@xymail.net]
> > Sent: Wednesday, August 06, 2003 11:35 PM
> > To: struts-user@jakarta.apache.org
> > Subject: how to use requiredif
> > 
> > Hi all,
> > 
> > I hava question about the use of required in the validation.xml
> file.My
> > example is :
> >       <field property="conPassword" depends="requiredif">
> >         <arg0 key="prompt.confirm.password"/>
> >         <var>
> >           <var-name>test</var-name>
> >           <var-value>((newPassword != null)</var-value>
> >         </var>
> >       </field>
> > Is it right? If it's wrong, please give me a right example.
> > Thanks a lot. :)
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: how to use requiredif

Posted by George Hill <ge...@xymail.net>.
thank you. i understand it. can you tell me where can i find all the validator document? i have searched the struts 1.1 document, but find a little.
----- Original Message ----- 
From: "Alex Shneyderman" <al...@law.columbia.edu>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, August 07, 2003 7:11 PM
Subject: RE: how to use requiredif


> <field property="phone" depends="requiredif">
> <arg0 key="venue.phone" />
> <var>
> <var-name>field[0]</var-name>
> <var-value>venueId</var-value>
> </var>
> <var>
> 
> <var-name>field-test[0]</var-name>
> <var-value>EQUAL</var-value>
> </var> 
> <var>
> 
> <var-name>field-value[0]</var-name>
> <var-value>0</var-value>
> </var> 
> </field>
> 
> here is an example where phone is required if venueId is EQUAL to 0.
> There are couple of other options for the kind of test just look it up
> in FiledsCheck validator.
> 
> > -----Original Message-----
> > From: georgehill [mailto:georgehill@xymail.net]
> > Sent: Wednesday, August 06, 2003 11:35 PM
> > To: struts-user@jakarta.apache.org
> > Subject: how to use requiredif
> > 
> > Hi all,
> > 
> > I hava question about the use of required in the validation.xml
> file.My
> > example is :
> >       <field property="conPassword" depends="requiredif">
> >         <arg0 key="prompt.confirm.password"/>
> >         <var>
> >           <var-name>test</var-name>
> >           <var-value>((newPassword != null)</var-value>
> >         </var>
> >       </field>
> > Is it right? If it's wrong, please give me a right example.
> > Thanks a lot. :)
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

RE: how to use requiredif

Posted by Alex Shneyderman <al...@law.columbia.edu>.
			<field property="phone" depends="requiredif">
				<arg0 key="venue.phone" />
				<var>
					<var-name>field[0]</var-name>
					<var-value>venueId</var-value>
				</var>
				<var>
	
<var-name>field-test[0]</var-name>
					<var-value>EQUAL</var-value>
				</var>				
				<var>
	
<var-name>field-value[0]</var-name>
					<var-value>0</var-value>
				</var>			
			</field>

here is an example where phone is required if venueId is EQUAL to 0.
There are couple of other options for the kind of test just look it up
in FiledsCheck validator.

> -----Original Message-----
> From: georgehill [mailto:georgehill@xymail.net]
> Sent: Wednesday, August 06, 2003 11:35 PM
> To: struts-user@jakarta.apache.org
> Subject: how to use requiredif
> 
> Hi all,
> 
> I hava question about the use of required in the validation.xml
file.My
> example is :
>       <field property="conPassword" depends="requiredif">
>         <arg0 key="prompt.confirm.password"/>
>         <var>
>           <var-name>test</var-name>
>           <var-value>((newPassword != null)</var-value>
>         </var>
>       </field>
> Is it right? If it's wrong, please give me a right example.
> Thanks a lot. :)



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org