Sunday, June 08, 2008

Struts2 checkboxlist UI tag rendering one item per line
After struggling with this UI tag for a some time today, I gave up and was attempting to use s:checkbox inside of an s:iterator to render one item per line, unsuccessfully.

So, upon revisiting s:checkboxlist, I found that it's a relatively painless thing to override the checkboxlist.ftl file described here, http://struts.apache.org/2.0.9/docs/template-loading.html, add a break at the end of this line

<label for="${parameters.name?html}-${itemCount}" class="checkboxLabel">${itemValue?html}</label><br />
and save the file in the webapp/template/simple dir of my web application.

No comments: