I'm sure this is a total noob question and I'm missing a blatant error, but here goes anyway.
I have a command object:
public class LeadCommand {
Integer OwnerId
String FirstName
String LastName
String Email
String Phone1
String Company
String StreetAddress1
String City
String State
String PostalCode
String Country
String Leadsource
static constraints = {
OwnerId(blank: false)
FirstName(blank: false)
LastName(blank: false)
Email(blank: false, email: true)
Phone1(blank: false)
Company(blank: false)
StreetAddress1(blank: false)
City(blank: false)
State(blank: false)
PostalCode(blank: false)
Country(blank: false)
Leadsource(blank: false)
}
}
And a controller action:
def process = { LeadCommand cmd ->
if (cmd.hasErrors()) {
redirect(action: index)
} else {
// do stuff
}
}
The command object is getting populated, but is not following the validation constraints that I setup. I've read through the docs a couple of times, but I must be missing something...
Thanks in advance
BTW - I'm using Grails 1.3.7
EDIT:
Here is some sample post data: (straight from params map)
[Phone:,
OwnerId:1,
Country:United States,
LastName:,
City:,
PostalCode:,
State:,
Email:,
Leadsource:,
FirstName:,
Submit:Submit,
Company:,
StreetAddress1:,
action:process,
controller:leadEntry]