-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
Please let me know if this is/was a good idea. With the addition of the
<spring:nestedTag> functionality, I needed to extend the <spring:bind>
tag a little bit. I needed to get the errors for a property and all of
its fields. The previous bind tag only understood .* to be "all errors
of the bound object". I extended it to allow .* at the end of any
object in the graph.
For instance, you can now do this:
public class Command {
~ public SubCommand getSubCommand() { }
}
<spring:nestedPath path="command">
~ <spring:bind path="subCommand.*">
~ <c:if test="${status.errors}">
~ Errors inside the subCommand child object!
~ </c:if>
~ </spring:bind>
</spring:nestedPath>
This way, a bind request can ask for all errors on an object. We find
this very useful when displaying pages. For instance, we use 3 drop
downs for a date (month, day, year). We want to say "Are there errors
on the date?" instead of "Are there errors on date.day, date.month, or
date.year?"
Attached is a patch that makes this work. I hope the intent is clear,
and if Juergen likes it, he can/should clean it up. A test is included
as well.
Ideas? Thoughts? I know I've been pushing the limited of the bind tag
and usage lately. If there is a better way to do this, please let me know.
Thanks,
Seth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAtPWhKZsFSwtW+wIRAnI7AJ9v5Ogg3t8ZSy6Xl75vmTWiZSqNgQCfSX4X
ZbhuQVzdzicPsnxnNJ67irs=
=AHXb
-----END PGP SIGNATURE-----
|