I'm also interested in this, I have for example a valiable list of Contacts
the validation works well for 1 contacts, but I must apply the same validation for the others.
valang:
Code:
{ contact[0].name : ? is not blank : 'es required' : 'contactNameEmpty' }
form:
Code:
<@spring.bind "contacts.contact[0].name" />
name: <input type="text" name="${spring.status.expression}" value="${spring.status.value?default("")}"><@spring.showErrors ", " "error" /><br>
...
<@spring.bind "contacts.contact[1].name" />
name: <input type="text" name="${spring.status.expression}" value="${spring.status.value?default("")}"><@spring.showErrors ", " "error" /><br>
databinder:
Code:
public class ContactsInputBinder {
private List contacts= LazyList.decorate(new ArrayList(), FactoryUtils.instantiateFactory(Contact.class));
public IngresoClienteBinder()
{
}
public List getContacts() {
return contacts;
}
public void setContacts(List contacts) {
this.contacts= contacts;
}
}
I don't know beforehand how many contacs there are, so how can I write the validator?