Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

h:selectManyCheckbox selections in table or grid layout?

843844May 24 2007 — edited May 31 2007
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2007
Added on May 24 2007
2 comments
456 views