This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes how to add a seperator in <h:selectOneMenu> Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "how to add a seperator in <h:selectOneMenu>" Watch "how to add a seperator in <h:selectOneMenu>" New topic
Author

how to add a seperator in <h:selectOneMenu>

Naresh Gunda
Ranch Hand

Joined: Oct 15, 2005
Posts: 163


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

Joined: Jun 25, 2001
Posts: 14480
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to add a seperator in <h:selectOneMenu>
 
Similar Threads
How to perform operations like insert,delete,add,move next etc in jsp page?
How to Configure SSL over Database in Spring?
Can you have condition in <h:selectOneMenu> ?
Using Operators in Drop down
Can not Populate the form on combo box change