struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Lipofsky" <daniel.lipof...@bricsnet.com>
Subject Validate only if existing
Date Wed, 29 Dec 2004 02:36:23 GMT
I have a field I want to require only if the bean
it exists inside exists (is not null).

I cannot use validwhen because I am using struts 1.1.

I tried to use requiredif like this

	<form name="/ChargeTypeStore">
		<field property="chargeTypeDTO.name"
depends="requiredif">
			<arg0 key="LeaseChargeTypeDTO.name"/>
			<var>
				<var-name>field[0]</var-name>
				<var-value>chargeTypeDTO</var-value>
			</var>
			<var>
				<var-name>fieldTest[0]</var-name>
				<var-value>NOTNULL</var-value>
			</var>
		</field>
	</form>

but I get

org.apache.commons.beanutils.NestedNullException:
Null property value for 'chargeTypeDTO'

I want to require chargeTypeDTO.name if and only if
chargeTypeDTO is not null.  Can I do this in struts 1.1?
Thanks,
Dan


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


Mime
View raw message