You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Muhammad Owais <mu...@yahoo.com> on 2009/07/11 15:09:20 UTC

XML Validation

Dear All;
I wnat to validate a String that is similare to "1,102,Y".I was trying to implement it, but it is not working.
			<field property="scheduleDateStr" depends="requiredif">				<arg0 key="label.scheduleDateStr" />				<var>					<var-name>field[0]</var-name>					<var-value>actionType1</var-value>				</var>				<var>					<var-name>fieldValue[0]</var-name>					<var-value>1,102,Y</var-value>				</var>			</field>
Please suggest

With regards and stay in touch !  Allah Hafiz     Muhammad Owais Bilal Awan,
+966-56-5823-940


      

Re: XML Validation

Posted by Dave Newton <ne...@yahoo.com>.
Muhammad Owais wrote:
> Dear All;
> I wnat to validate a String that is similare to "1,102,Y".I was trying to implement it, but it is not working.
> <field property="scheduleDateStr" depends="requiredif">
 >   <arg0 key="label.scheduleDateStr" />
 >   <var>					
 >     <var-name>field[0]</var-name>					
 >     <var-value>actionType1</var-value>
 >   </var>				
 >   <var>
 >     <var-name>fieldValue[0]</var-name>
 >     <var-value>1,102,Y</var-value>
 >   </var>
 > </field>


Here it looks like you're trying to use "requiredif", which is a 
deprecated validator used for conditional validation, to validate the 
format of a string, which would normally be handled by a regular 
expression (or manual validation) -- the "mask" validator.

Note that "requiredif" is deprecated for "validwhen", but you don't 
mention what version of Struts you're using, so I don't know if that's 
useful information or not.

Dave

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