You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jorge Mascena <jo...@cesar.org.br> on 2003/03/17 21:46:26 UTC

Nested property validation

Is there a way to validate a nested property when the outter property is
a collection? For example, can I have a validation (using Struts
Validator) like (using the nested tag sample app with monkeys and
bananas): "all bananas MUST have a description"?

I know it would be possible to have a set of custom validators to check
these cases (nestedRequired, nestedMaxlength etc.), but I'd like to know
if it's possible to do the same thing using the basic validators,
instead of having to duplicate all of them. Something like:

        <form name="monkeyForm">
            <field property="bunch.banana.description"
depends="required">
                <arg0 key="banana.description"/>
            </field>
        </form>

And that would automatically validate the description of all bananas of
the bunch.

Thanks in advance for any help.

Jorge Mascena


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