Skip to content

Commit 88cc712

Browse files
author
graeme
committed
fix for GRAILS-1493
git-svn-id: https://svn.codehaus.org/grails/trunk@5268 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent ff89ab8 commit 88cc712

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ValidationTagLib.groovy

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ class ValidationTagLib {
7474
if(errors) {
7575
if(attrs['field']) {
7676
if(errors.hasFieldErrors(attrs['field'])) {
77+
def e = errors.getFieldErrors(attrs['field'])
78+
def errorArgs = e.arguments[0]
79+
80+
if (i.class == errorArgs[1]) {
81+
out << body()
82+
}
7783
out << body()
7884
}
7985
}
@@ -124,13 +130,20 @@ class ValidationTagLib {
124130
if(attrs['field']) {
125131
if(errors.hasFieldErrors(attrs['field'])) {
126132
errors.getFieldErrors( attrs["field"] ).each {
127-
out << body(it)
133+
def args = it.arguments
134+
135+
if (i.class == args[1]) {
136+
out << body(it)
137+
}
128138
}
129139
}
130140
}
131141
else {
132142
errors.allErrors.each {
133-
out << body( it )
143+
def errorArgs = it.arguments
144+
if (i.class == errorArgs[1]) {
145+
out << body( it )
146+
}
134147
}
135148
}
136149
}

0 commit comments

Comments
 (0)