This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Default a g:checkBox to checked?

 
Joe Nelson
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, Ive been fighting this for a while and cannot figure it out. I'm new to Grails, so have mercy.

I have a need to set a checkbox as checked as the default. I've been able to get the checkbox to work with my query when I leave it as unchecked as default.

My checkbox definitions is:



I have tried setting the "checked" attribute and I've tried various permutations of setting the params.areDuplicatesExcluded in my controller. But so far, everything I have tried either has no effect at all, or sets the parameter to checked no matter how the box is set.

I know this should be easy, but I have hit a brick wall.

Any help would be appreciated. How do I default the checkbox to checked and still get it to work?
 
jake lopez
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<g:checkBox name="areDuplicatesExcluded" value="true" checked="${params.areDuplicatesExcluded}"/>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic