File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes How to align items inside the selectManyCheckbox ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to align items inside the selectManyCheckbox ?" Watch "How to align items inside the selectManyCheckbox ?" New topic

How to align items inside the selectManyCheckbox ?

Sathya Vantheymatharam

Joined: Jan 18, 2011
Posts: 1
Hi All,

i want to align the items inside the selectManyCheckBox.

<h:selectManyCheckbox value="#{baseAction.hlrAppService.eps.notAllowedRATTypes}">
<f:selectItem itemLabel="A" itemValue="LAN" />
<f:selectItem itemLabel="B" itemValue="RAN" />
<f:selectItem itemLabel="C" itemValue="GRAN" />
<f:selectItem itemLabel="D" itemValue="GAN" />
<f:selectItem itemLabel="E" itemValue="HION" />
<f:selectItem itemLabel="F" itemValue="CX" />
<f:selectItem itemLabel="G" itemValue="HD" />
<f:selectItem itemLabel="H" itemValue="UB" />
All the items are getting displayed in a single line but I want to display only 3 item in a line? is there any way to do this?

Thanks in Advance.

John Tannel

Joined: Dec 17, 2010
Posts: 23

As far as I know there is no good way to accomplish this without third party libraries. In my old project, we ended up using multiple select many checkboxes, each with their own setters and getters. When a setter was called, it would simply set the list for it's own data field. When we needed a master list, we had a method that would concatenate the two lists and return it. We only needed 2 columns so it was easy to hardcode two selectMany's and use layout="pageDirection" . If you need a dynamic number of rows/columns then I'm not sure what you could do. I hope this helps some.
Aba Dov

Joined: Jan 24, 2011
Posts: 6

you could use tomahawk lib

and use layout and layoutWidth attribute

I agree. Here's the link:
subject: How to align items inside the selectManyCheckbox ?
jQuery in Action, 3rd edition