Skip to content

Commit

Permalink
customizedFields support for f:checkbox (and thus also f:optionalBlock).
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Aug 26, 2013
1 parent 3ce3ec4 commit 554d0a0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/main/resources/lib/form/checkbox.jelly
Expand Up @@ -56,15 +56,21 @@ THE SOFTWARE.
</st:attribute>
</st:documentation>
<f:prepareDatabinding />
<j:set var="name" value="${attrs.name ?: '_.'+attrs.field}"/>
<j:set var="default" value="${attrs.default ?: false}"/>
<j:set var="value" value="${attrs.checked ?: instance[attrs.field] ?: default}"/>
<input type="checkbox"
name="${attrs.name?:'_.'+attrs.field}"
name="${name}"
value="${attrs.value}"
title="${attrs.tooltip}"
onclick="${attrs.onclick}" id="${attrs.id}" class="${attrs.negative!=null ? 'negative' : null} ${attrs.checkUrl!=null?'validated':''}"
checkUrl="${attrs.checkUrl}" checkDependsOn="${attrs.checkDependsOn}" json="${attrs.json}"
checked="${(attrs.checked ?: instance[attrs.field] ?: attrs.default) ? 'true' : null}"/>
checked="${value ? 'true' : null}"/>
<j:if test="${attrs.title!=null}">
<label class="attach-previous"
title="${attrs.tooltip}">${attrs.title}</label>
</j:if>
<j:if test="${customizedFields != null and value != default}">
<j:mute>${customizedFields.add(name)}</j:mute>
</j:if>
</j:jelly>

0 comments on commit 554d0a0

Please sign in to comment.