Snippet:
Code:
<g:form action="startSimu" controller="lpicSimulator">
<g:if test="${questionsList101 != null && !questionsList101.isEmpty()}"> Bereich 101:<br/>
<g:each in="${questionsList101}" var="elem" status="i">
<g:checkBox name="eins" value="${questionsList101[i].id}" checked="false"/>${i+1}<br/>
</g:each>
<br/>
</g:if>
<g:if test="${questionsList102 != null && !questionsList102.isEmpty()}">
Bereich 102:<br/>
<g:each in="${questionsList102}" var="elem" status="i">
<g:checkBox name="zwei" value="${questionsList102[i].id}" checked="false"/>${i+1}<br/>
</g:each>
<br/>
</g:if>
<g:if test="${questionsList103 != null && !questionsList103.isEmpty()}">
Bereich 103:<br/>
<g:each in="${questionsList103}" var="elem" status="i">
<g:checkBox name="drei" value="${questionsList103[i].id}" checked="false"/>${i+1}<br/>
</g:each>
<br/>
</g:if>
......
Code:
params.eins.each{i-> cacheService.questionList.add(i); }
params.zwei.each{i-> cacheService.questionList.add(i); }
params.drei.each{i-> cacheService.questionList.add(i); }
I think its very easy, because with the second snippet, I only get the checkboxes which were checked... Of course, Ive got to know the name of the checkbox-list, but with your solution this would be similiar, wouldnt it?
thank you