• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

h:selectOneMenu

 
Ranch Hand
Posts: 40
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 40
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2166
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic