Quantcast

Validation messages - domain and property not being substituted - getting raw message

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Validation messages - domain and property not being substituted - getting raw message

astubbs
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?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Validation messages - domain and property not being substituted - getting raw message

Sachin Anand
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:

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?

--
View this message in context: http://grails.1312388.n4.nabble.com/Validation-messages-domain-and-property-not-being-substituted-getting-raw-message-tp3465144p3465144.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
With Regards

Sachin Anand
[hidden email]
Intelligrape Software (P) Ltd.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Validation messages - domain and property not being substituted - getting raw message

astubbs
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:

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:

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?

--
View this message in context: http://grails.1312388.n4.nabble.com/Validation-messages-domain-and-property-not-being-substituted-getting-raw-message-tp3465144p3465144.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
With Regards

Sachin Anand
[hidden email]
Intelligrape Software (P) Ltd.




To unsubscribe from Validation messages - domain and property not being substituted - getting raw message, click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Validation messages - domain and property not being substituted - getting raw message

astubbs
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Validation messages - domain and property not being substituted - getting raw message

Sachin Anand
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:

<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

--
View this message in context: http://grails.1312388.n4.nabble.com/Validation-messages-domain-and-property-not-being-substituted-getting-raw-message-tp3465144p3465181.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
With Regards

Sachin Anand
[hidden email]
Intelligrape Software (P) Ltd.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Validation messages - domain and property not being substituted - getting raw message

astubbs
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

 <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 <<a href="x-msg://84/user/SendEmail.jtp?type=node&amp;node=3465224&amp;i=0&amp;by-user=t" target="_top" rel="nofollow" link="external">[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

--
View this message in context: http://grails.1312388.n4.nabble.com/Validation-messages-domain-and-property-not-being-substituted-getting-raw-message-tp3465144p3465181.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
With Regards

Sachin Anand
<a href="x-msg://84/user/SendEmail.jtp?type=node&amp;node=3465224&amp;i=1&amp;by-user=t" target="_top" rel="nofollow" link="external">[hidden email]
Intelligrape Software (P) Ltd.




To unsubscribe from Validation messages - domain and property not being substituted - getting raw message, click here.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Validation messages - domain and property not being substituted - getting raw message

astubbs
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

 <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 <<a href="x-msg://87/user/SendEmail.jtp?type=node&amp;node=3465224&amp;i=0&amp;by-user=t" target="_top" rel="nofollow" link="external">[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

--
View this message in context: http://grails.1312388.n4.nabble.com/Validation-messages-domain-and-property-not-being-substituted-getting-raw-message-tp3465144p3465181.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
With Regards

Sachin Anand
<a href="x-msg://87/user/SendEmail.jtp?type=node&amp;node=3465224&amp;i=1&amp;by-user=t" target="_top" rel="nofollow" link="external">[hidden email]
Intelligrape Software (P) Ltd.




To unsubscribe from Validation messages - domain and property not being substituted - getting raw message, click here.

Loading...