By default checkboxlist uses the element
name as
id for the checkbox and label.
You have to use custom theme, and edit the checkboxlist.ftl file.
you need to make changes at two places:
1: default:
<input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}"
id="${parameters.name?html}-${itemCount}"<#rt/>......
change to:
<input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}"
id="${parameters.id?html}-${itemCount}"<#rt/>
(changes parameters.name to parameters.id), also for the lable to work correctly,
2: default:
<label for="${parameters.name?html}-${itemCount}" class...
change to:
<label for="${parameters.id?html}-${itemCount}" class...
(again, parameters.name to parameters.id)
Note: i have extended simple theme. if you want to know how to create custom theme, the best way is to download and extract the struts2 core jar.
Goto /templates/simple, copy all files to your project dir: /templates/{theme name}
you can set the project default theme to the new theme, try googling if you need more info...