struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rassmann, Natalie D" <natalie.d.rassm...@lmco.com>
Subject Re: Validate values in a collection
Date Fri, 26 Sep 2003 10:13:42 GMT
Timo,

I would try to avoid using the requiredif because it will be deprecated with the
next release of struts.  validwhen will replace it.  validwhen is much more
powerful and easier to use.  To get the validwhen code, you have to go and
download a nightly build.  I just did it a few days ago and everything works
fine.  I actually built the validwhen stuff into my app rather than used the new
struts.jar file.

If you don't want to try and use the validwhen then you can modify Matt Raible's
design for validating two fields.  I did that too.  The only problem I had was
when I was trying to validate an indexed property and a non-indexed property.  The
getProperty method in the common-beanutils kept getting an error when trying to
use reflection to find the second property (the one that was not no part of the
collection).  In other words, I was trying to compare an item in an ArrayList with
a property that was just a String (not part of the ArrayList).  I had and still am
having problems with that.  I am going to try again this morning and try to get it
to work because the validateTwoFields works great when it works.

http://www.raibledesigns.com/page/rd/20030226#struts_validator_validating_two_fields


I hope this helps,

Natalie

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


Mime
View raw message