开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜