views:

137

answers:

1

Hi, 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

A: 

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.

Michael Borgwardt