If you want to validate generated fields, i mean a Collection you can do
something like this.
* Action class
private List collection;
public void setCollection(String collection) {
this.collection = collection;
}
public String getCollection() {
return collection;
}
List list = this.getCollection() ;
for (int i = 0; i < list.size(); i++) {
if(list.get(i).equals(""))
addFieldError("collection[" + i + " ]
",getText("validation.required"));
}
by fgsantoyo
Julio Alberto Jalón wrote:
>
>
> I'm learning struts2 through the struts2-showcase application example.
> From the "Person Manager" functionality I've learned how to send multiples
> values from client to server using collections to manage these values, but
> now I'd like to know how to validate these values using struts2
> validation. I don't know what to put in *-validation.xml in order to
> validate these values. Should I use custom validation?
>
> Thanks in advance.
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/Struts2-Collection-validation-tp19991675p20255180.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]