Como exibir minhas constraints em um radio button?
11/10/2012 20:13
class Formulario {
String nome
String cargo
static constraints = {
nome maxSize:60, blank: false, nullable: false
cargo inList:['Presidente', 'Diretor', 'Gerente', 'Supervisor', 'Assistente', 'Secretario'], blank: false, nullable: false
}
}
<g:each in="${formularioInstance.constraints.cargo.inList}" >
${it} <input type="radio" value="${it}"/> <br/>
</g:each>
Cannot get property 'cargo' on null object
${Formulario.constraints.cargo.inList} // a classe direto
${new Formulario().constraints.cargo.inList} //objeto anônimo
http://grails.1312388.n4.nabble.com/Cannot-get-property-constraints-on-null-object-with-embedded-domain-td4554164.html
Para se registrar, clique aqui.