h:selectManyCheckbox selections in table or grid layout?
843844May 24 2007 — edited May 31 2007I have what I thought would be a very easy requirement, but after many attempts I wonder if this is possible with JSF.
I have a simple h:selectManyCheckbox that I want to render dynamically with select items pulled from a database. There can be anywhere between 1 to 20 (or more) select items. I want to render all the selections in 2 or 3 columns; however, I have tried many things that don't seem to change the default layout attributes (page or line). If I select "line" layout, the selections get bunched together on one line. With page, they line up nicely in a vertical fashion, but there is way too much wasted space to the right of each selection.
<h:selectManyCheckbox value="#{myBean.responses}">
<f:selectItems value="#{myBean.selections}" />
</h:selectManyCheckbox>
Is there a way dynamically render the selectItems in a 2 or 3 column grid (or table)?
BTW - I've found a MyFaces component with a grid layout attribute that would work perfectly; however, I would like to avoid introducing a new RI implementation for a single component.
Thanks,
Tom