This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to align items inside the selectManyCheckbox ?" Watch "How to align items inside the selectManyCheckbox ?" New topic
Author

How to align items inside the selectManyCheckbox ?

Sathya Vantheymatharam
Greenhorn

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" />
</h:selectManyCheckbox>
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
Greenhorn

Joined: Dec 17, 2010
Posts: 23
Sathya,

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
Greenhorn

Joined: Jan 24, 2011
Posts: 6

Hi,
you could use tomahawk lib


and use layout and layoutWidth attribute


Regards
 
Consider Paul's rocket mass heater.
 
subject: How to align items inside the selectManyCheckbox ?