From what I see you want to dynamically update the backend as the user clicks the check box?
If so then you need an ajax call something like this would do it:
<g:each in="${bookInstanceList}" status="i" var="bookInstance">
<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
<td><g:link action="show" id="${bookInstance.id}">${fieldValue(bean: bookInstance, field: "author")}</g:link></td>
<td><g:checkBox name="sold" value="${bookInstance?.sold}" onChange="TriggerFilter(this)" /></td>
<td>
</tr>
</g:each>
<g:javascript>
function TriggerFilter(e) {
if (e.checked==true) {
$.get('<g:createLink action='Your_Action' controller="YourController"
params="[ filterbind: ''+attrs.filterbind+'',term:''+attrs.term+'' ]"/>'
,function(data){
$('#FilterField').hide().html(data).fadeIn('slow');
});
}else{
$('#FilterField').hide().html('').fadeIn('slow');
}
}
</g:javascript>
<div id="FilterField" class="filterField">
{Result returned in here}
</div>
You need to fit it e.value into the params take a look at grails java script get createLink there are lots of examples in my plugin here:
https://github.com/vahidhedayati/ajaxdependancyselection/tree/master/grails-app/views
and I would suggest looking online/reading on how to use it
You may wish to change the get to :
how to use grails ${createLink} in javascript
var url = '${createLink(controller:'Books', action: 'update')}' + e.value ;
$.get(url ,function(data){
$('#FilterField').hide().html(data).fadeIn('slow');
});
}else{
$('#FilterField').hide().html('').fadeIn('slow');
}
}