Search code examples
groovyuppercasegrailslinkfieldvalue

Grails: How to make everything I create Upper Case?


I am currently using CSS to change everything I write to upperCase when I create an entry, but that is not enough. When I save things, the text shown in the text fields is upper case, but the real value that Grails stores stays in lower case.

I am assuming I'd need to change something in the controller or anything.

Maybe transforming the $fieldValue CSS could work??

Any ideas would help!

Thnks!


Solution

  • You could just write setters for your domain object?

    class Domain {
     String aField
    
     void setAField( String s ){
       aField = s?.toUpperCase()
     }
    }