This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

selectManyCheckBox within a panelgrid?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I am quite new to JSF and am currently struggling to get my long list of check boxes spread over a grid rather than in one line either horizontally or vertically off of the page. The list is in excess of 40 check boxes and I would to show them in a grid/table say 10 columns wide.

I have looked at panelGrid and have set this up, but I cannot work out how to display the checkboxes as I have described?

My code:

<h:panelGrid columns="8" footerClass="subtitle" headerClass="subtitlebig" styleClass="medium" columnClasses="subtitle,medium" style="width:100%">
<f:facet name="header">
<h:outputText value="Current Stop Words" />
</f:facet>
<h:inputText
<h:selectManyCheckbox id="StopWords" value="#{UserBean.stopWords}" >
<f:selectItems value="#{UserBean.stopWords}" />
</h:selectManyCheckbox>
/>
</h:panelGrid>

With my UserBean looking like this:

public List<SelectItem> getStopWords()
{
return f.stopWords;
}

Where f.stopWords is:

List<SelectItem> stopWords = new ArrayList<SelectItem>();

and is populated with:

private void setupStopWords()
{
for (int i = 0; i < exclusionWords.length; i++)
{
stopWords.add(new SelectItem(i,(String)exclusionWords[i]));
}
}

To confirm, my checkbox works, I just want to know how to change the display of the checkboxes over multiple columns? If anyone could advise, or a URL link to a decent tutorial (I can't find one through google), or perhaps I am going about this the wrong way?
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Anthony...though you have put much effort in explaining the problem but unfortunately I could not get the clear picture.

Would it be possible for you to give a pictorial representation of your requirement coz I feel this can be easily done using a datatable.
 
Anthony Smee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

Thank you for your reply, I forgot to update this forum with the outcome of another: http://forums.sun.com/thread.jspa?messageID=10829990#10829990

And a picture is attached.
mutli-ticks.jpg
[Thumbnail for mutli-ticks.jpg]
Mutli-tcis
 
Attractive, successful people love this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!