|
I get the following output for validation errors in my gsp:
Property [{0}] of class [{1}] cannot be blank So as you can see the property name and domain aren't being substituted / replaced/ inserted or whatever... I've searched around about this but haven't found anything - it's a bit hairy. Any ideas? |
|
Can you please provide some code with it and also check your messages.properties file.
It seems like some how args are not getting passed in g:message tag.
On Thu, Apr 21, 2011 at 10:58 AM, astubbs <[hidden email]> wrote: I get the following output for validation errors in my gsp: -- With Regards Sachin Anand [hidden email] Intelligrape Software (P) Ltd. |
|
I will in 10 minutes. All the messaging stuff is stock standard - I haven't tried customising anything yet. I'm using g:rendererrors and g:eacherror (tried both). Thanks for your response - I've just stepped out to get a snack. On 21/04/2011, at 1:39 AM, "Sachin Anand [via Grails]"<[hidden email]> wrote:
|
|
Ok, so I'm printing it out like:
<g:hasErrors> <div class="errors"> <g:renderErrors bean="donationInstance" as="list" /> <g:eachError><p>${it.defaultMessage}</p></g:eachError> </div> </g:hasErrors> And my message.properties looks normal: default.blank.message=Property [{0}] of class [{1}] cannot be blank |
|
This works for me
<g:hasErrors bean="${domainInstance}"> <div class="errors"> <g:renderErrors bean="${domainInstance}" as="list"/> </div> </g:hasErrors> Seems like you have an extra each error tag. On Thu, Apr 21, 2011 at 11:29 AM, astubbs <[hidden email]> wrote: Ok, so I'm printing it out like: -- With Regards Sachin Anand [hidden email] Intelligrape Software (P) Ltd. |
|
I added the eachError tag so I could see what other beans in the scope would output for their errors. If I remove it to match your quote, i still have the same problem.
On 21/04/2011, at 2:38 AM, Sachin Anand [via Grails] wrote: This works for me |
|
In reply to this post by Sachin Anand
Ok, duh moment.
It should be: <g:eachError><p><g:message error="${it}"/></p></g:eachError> Which prints it out as expected. ${it} in this case is the error object. So .defaultMessage is just the message template, without the substitution. On 21/04/2011, at 2:38 AM, Sachin Anand [via Grails] wrote: This works for me |
| Powered by Nabble | Edit this page |
