Grails database checkboxes best practices to load and process
I have a collection of checkboxes loaded from a table that are loaded in a gsp (via a controller). Are there any best practices 开发者_如何学编程in grails to display them and process them once the form is submitted ? I wouldn't like to use the "manual" approach (i.e, composing the checkboxxes'id with the table row's id).
Thanks
Have you tried using indexed parameters, i.e.
<g:checkBox name="table[${index}].property" value="${tableInstance.property}" />
I've had some problems with that, and several solutions described in this SO question. Note that that was in Grails 1.0.4 - it's possible that those problems have disappeared in recent versions.
精彩评论