I am still struggling with checkbox implementation since I havent found a comprehensive example. On the gsp, things are fine, but I do not know how to persist the checked items on the controller-side. Any help will be most appreciated.
gsp:
controller:
gsp:
Code:
<g:each in="${TBSMS.TBDrug.list(sort: 'id', order: 'asc')}" var="tbdrug" status="i">
<label for="tbdrugs">${tbdrug.name}</label>
<g:checkBox name="tbdrugs" value="${tbdrug.id}" checked="${specimenInstance?.patienttbdrug?.tbdrug? specimenInstance?.patienttbdrug?.tbdrug.contains(tbdrug) : 'false'}" />
</g:each>
controller:
Code:
??? - how do I persist the selected entries in the selectbox above?