• Post Reply Bookmark Topic Watch Topic
  • New Topic

h:selectOneMenu  RSS feed

 
Wim Van Geyt
Ranch Hand
Posts: 32
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I want to use in JSf a selectOneMenu for a navigation menu in a website.

When I use it, it works as it is designed. When you select an item, it shows at the top of the dropdown.

Can you make the selection not apear at the top?

Or should I use some other tag to implement a dropdown menu?

Kind regards
Wim
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I don't understand what you mean. The selectOneMenu renders as an HTML SELECT/OPTION dropdown list and its behavior is defined as such.
 
Wim Van Geyt
Ranch Hand
Posts: 32
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Tim

i understand.

Is there another way to implement a dropdown navigation menu.

e.g.: page navigation buttons with dropdown options.

I put a screenshot of the navigation i want.

Naamloos.png
[Thumbnail for Naamloos.png]
website page navigation Screenshot
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah. Now I see. You want a multi-level menu.

The core JSF tagset only implements fundamental HTML tags with no enhancements. Obviously with appropriate CSS and JavaScript you can get menus like what you're demonstrating, but not with HTML alone.

The easiest way to get this sort of multi-level menu in a JSF environment is to employ one of the JSF extension tagsets such as RichFaces or PrimeFaces. Many of these extensions do actually have exactly what you want and they do it in a JSF-friendly way so they're easier to work with than if you'd simply applied one of the JavaScript UI libraries instead.
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like said before, in most cases it is a very good idea to add one of the extension tagsets. Primefaces is a popular option among those for good reason.
When I started, the showcase was a good help. Here is something similar to which you may want to acomplish:
http://www.primefaces.org/showcase/ui/menu/menubar.xhtmlPowerVM

On the top an example of the wiget and below the code to accomplish it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!