Repository: struts Updated Branches: refs/heads/develop 1fae47dfc -> 9a94699da
WW-4313 Uses name instead of id if the other isn't set Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9a94699d Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9a94699d Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9a94699d Branch: refs/heads/develop Commit: 9a94699da0f1044cf0dad1acd717fccb715e45ea Parents: 1fae47d Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Sun Mar 30 09:45:45 2014 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Sun Mar 30 09:45:45 2014 +0200 ---------------------------------------------------------------------- .../main/resources/template/simple/checkboxlist.ftl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/9a94699d/core/src/main/resources/template/simple/checkboxlist.ftl ---------------------------------------------------------------------- diff --git a/core/src/main/resources/template/simple/checkboxlist.ftl b/core/src/main/resources/template/simple/checkboxlist.ftl index ba04196..3ce8686 100644 --- a/core/src/main/resources/template/simple/checkboxlist.ftl +++ b/core/src/main/resources/template/simple/checkboxlist.ftl @@ -56,8 +56,12 @@ </#if> </#if> <#assign itemKeyStr=itemKey.toString() /> -<input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}" +<input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}"<#rt/> + <#if parameters.id??> + id="${parameters.id?html}-${itemCount}"<#rt/> + <#else> id="${parameters.name?html}-${itemCount}"<#rt/> + </#if> <#if tag.contains(parameters.nameValue, itemKey)> checked="checked"<#rt/> </#if> @@ -90,7 +94,13 @@ <#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> <#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> /> -<label for="${parameters.name?html}-${itemCount}" class="checkboxLabel">${itemValue?html}</label> +<label<#rt/> + <#if parameters.id??> + for="${parameters.id?html}-${itemCount}"<#rt/> + <#else> + for="${parameters.name?html}-${itemCount}"<#rt/> + </#if> + class="checkboxLabel">${itemValue?html}</label> </@s.iterator> <#else>