« Return to Thread: hasErrors question

Re: RE: hasErrors question

by MikeHugo :: Rate this Message:

Reply to Author | View in Thread

Can you use a command object?   I assume you're validating that two form fields match, or that a string has certain requirements?  if so, check out this thread:

http://www.nabble.com/creating-errors-manually-td15745290.html#a15745858


On May 15, 2008, at 2:46 PM, Callaway, Pamela wrote:

Okay, I found setErrors(Errors errors), but Errors is an interface, not a class.  What would I create to make an Error to go in there?  I want to add in some validations of a password, but the password is not a property of the class, just  the passwordHash, so I can use constraints to do the validations.
 
Thanks,
 
Pam
 
From: Callaway, Pamela [pcallaway@...] 
Sent: Thursday, May 15, 2008 3:40 PM
To: user@...
Subject: [grails-user] hasErrors question
 
Hi folks,
 
Thanks again for all your help – this list is an invaluable resource!
 
My question is about hasErrors…  I can see in the generated controller where it will call hasErrors() on an object.  How do I set errors like that?  I tried obj.hasErrors = true, but that didn’t work.  I don’t know what to search for, so I can’t find any documentation besides what the tag hasErrors does…
 
Thanks,
 
Pam

 « Return to Thread: hasErrors question

LightInTheBox - Buy quality products at wholesale price