You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wilson Chuei <wi...@pacific.net.au> on 2003/06/27 05:15:48 UTC

validator requiredif boolean values

Hi,

Can somebody pls tell me why the following validation is not firing?
(see xml snippet below)

contact.phoneBHVisible and contact.phoneBHRequired are booleans.

Essentially, what I want to do is that validate only when
contact.phoneBHVisible == true && contact.phoneBHRequired == true


Other fields on the same form are being validating correctly.  No observable
errors from the tomcat's stdout.

(I am using struts-1.1-rc2)

On another note, is it possible to patch 1.1-rc2 with the validwhen
valdator?

TIA,

w.

<field property="contact.phoneBHPrefix" depends="requiredif,mask,minlength">
	<arg0 key="label.contact.phoneBHPrefix"/>
	<arg1 name="minlength" key="${var:minlength}" resource="false"/>
	<var>
		<var-name>field[0]</var-name>
		<var-value>contact.phoneBHVisible</var-value>
	</var>
	<var>
		<var-name>fieldTest[0]</var-name>
		<var-value>EQUAL</var-value>
	</var>
	<var>
		<var-name>fieldValue[0]</var-name>
		<var-value>true</var-value>
	</var>
	<var>
		<var-name>field[1]</var-name>
		<var-value>contact.phoneBHRequired</var-value>
	</var>
	<var>
		<var-name>fieldTest[1]</var-name>
		<var-value>EQUAL</var-value>
	</var>
	<var>
		<var-name>fieldValue[1]</var-name>
		<var-value>true</var-value>
	</var>
	<var>
		<var-name>fieldJoin</var-name>
		<var-value>AND</var-value>
	</var>
	<var>
		<var-name>mask</var-name>
		<var-value>^[0-9]*$</var-value>
	</var>
	<var>
		<var-name>minlength</var-name>
		<var-value>2</var-value>
	</var>
</field>


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