Reputation: 869
I am having an issue that when an I return from adding or editing an entity, the param.book_hardcoverFlag is not set properly (there is no entry for that param anymore) if the check box is unchecked.
...
<td class="field">
<input type="checkbox" class="checkbox"
name="book_hardcoverFlag" id="book_hardcoverFlag"
value="Y" ${params.book_hardcoverFlag eq 'Y' ? 'checked' : ''}/>
</td>
...
When the form get populated, it is properly presented, but if you uncheck the box or if the box is never checked, then the params.book_hardcoverFlag is never set when it tries to save.
Upvotes: 0
Views: 222
Reputation: 3153
I think you should put it this way
<td class="field">
<input type="checkbox" class="checkbox"
name="book_hardcoverFlag" id="book_hardcoverFlag"
value="Y" checked="${params.book_hardcoverFlag eq 'Y' ? 'checked' : ''}" />
</td>
Notice that it will output checked="checked"
inside the tag.
Hope that fixes your problem!
Upvotes: 1