The doucmentation implies that you can make a menuitem perform navigation, although I have not been able to do that.
Assuming I can make the menuitem navigation to a page work, it looks the only way could make a menu bar that navigates to a "home" page would be to have a submenu with a child menuitem. Like this:
Code: Select all
<p:menubar>
<p:submenu label="Home" >
<p:menuitem label="Home" action="homePage.xhtml" ></p:menuitem>
</p:submenu >
</p:menubar >
What I would like to do is to be able to click on an item in the menubar to do the navigation without having to expand a submenu with a single item.
I'm looking for something like this:
Code: Select all
<p:menubar>
<p:menuitem label="Home" action="homePage.xhtml" />
</p:menubar >
org.primefaces.component.menuitem.MenuItem cannot be cast to org.primefaces.component.submenu.Submenu
This is related question:
- How do I make a p:menuitem navigate to a page? The first sample code I inserted, does not work, I do not navigate to the homePage.xhtml when the I click on the Home menuitem.
I;m working in NetBeans 6.9, JSF2.0, Glsssfish 3.0.1 using facelets.
Could anyone post a menu example (or direct me to one) that works in my development environment?
I have tried to mimic the showcase examples and examples in the user's guide to no avail.
So, I have 2 questions:
1) Can I create a menubar item that allows direct navigation to another page without requiring a submenu with a single menuitem child?
2) How do I make a menuitem child navigate to a page in the project?
Thanks for any help.