• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

CSS for individual selectItem tag  RSS feed

 
Greenhorn
Posts: 11
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want every option in selecOnemMenu to be displayed row and column as figure1.

Figure1.
myRadio1 myRadio2
myRadio3 myRadio4



<h:selectOneMenu value="#{user.favCoffee1}">
<f:selectItem itemValue="Cream Latte" itemLabel="Coffee3 - Cream Latte" />
<f:selectItem itemValue="Extreme Mocha" itemLabel="Coffee3 - Extreme Mocha" />
<f:selectItem itemValue="Buena Vista" itemLabel="Coffee3 - Buena Vista" />
<f:selectItem itemValue="Buena" itemLabel="Coffee3 - Buena" />
</h:selectOneMenu>


Can anyone help me out in this.
 
Bartender
Posts: 19731
92
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF renders selectOneMenu as an HTML SELECT and the selectItems as HTML OPTIONs. Although the specs say that you can attach CSS to OPTION elements, I know of absolutely no browsers that actually support that ability. Instead, they use the OPTION elements as data-only definitions without regard to display properties.

As far as 2 or more columns in a SELECT dropdown list, that simply isn't supported in HTML. Some of the JSF extension tagsets can do that, but they do it by generating "fake" HTML and using javascript to manipulate it, since the user's browser can't actually get the right display using basic HTML.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!