• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use g:checkbox list of values to update boolean value in domain

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I am relatively new to grails and have been trying to configuring a check box to set a boolean value to true when it is checked for a number of list items.

The relationship is a hasMany between two domains where the boolean canClose is set in the work domain. The other domain is called role.
I have set up the relationship so that work hasManyRoles and I would like my domain to reflect the boolean canClose being set to true for some of these roles based on what gets checked in the checkbox list.

I have managed to get the gsp working displaying the list with checkboxes beside each one but am unsure as to how to save the boolean as true once some of these roles are checked.

Any assistance would be greatly appreciated. I will post my code below:




GSP code:



 
reply
    Bookmark Topic Watch Topic
  • New Topic