Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to add a seperator in <h:selectOneMenu>  RSS feed

 
Naresh Gunda
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am using the code


Can you please tell me how can we add a horizontal separator in between selectItems in selectOneMenu
 
Tim Holloway
Saloon Keeper
Posts: 18636
70
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SelectOneMenu, despite its name, is not a true menu. It renders as an HTML SELECT control, and HTML SELECT doesn't support separators. About the best you can do is add an item to the select list that displays as a row of dashes ("-----------"), but unlike true separators, this item will be selectable itself, so you'd have to allow for that.

There are JSF extensions such as MyFaces Tomahawk and RichFaces that support GUI elements that look and feel more like true menus, but there's nothing like that in the core JSF tagset.
 
Maybe he went home and went to bed. And took this tiny ad with him:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!