commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre Torres <alexandre.tor...@gmail.com>
Subject Validator with tree levels of collections
Date Wed, 27 Apr 2005 14:44:10 GMT
I'm using commons validator with struts. My validator form got a little more 
tricky...
I have a component with class FormA that has a set of components of
class RowB that has a set of componens RowC. Something like

FormA {
public String getCode() {
}
public void setCode() {
}
public Vector getBRows() {
...
}
public void setBRows(Vector v) {
...
}
}

RowB {
public String getName() {
}
public void setName(String n) {
...
}
public Vector getCRows() {
...
}
public void setCRows(Vector v) {
...
}

}

RowC {
public String getName() {
}
public void setName(String n) {
...
}
}

I want to define a rule in validator where all "name" instances of
RowC,RowB and FormA should be required.
For FormA's property "code" I did:
..
<field property="code" depends="required">
<arg key="forma.code.displayname" />
</field>
..
to RowB I coded, using the example of Niall

<field property="name" indexedListProperty="rowsB" depends="required">
<arg key="forma.row.name.displayname" />
</field>

But , for RowC I could not figure out how to make it, since I may have
zero, one or more RowC values... can I use indexedListProperty="rowsB.rowsC" 
?

Thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message