Menubar Ordering Issue

UI Components for JSF
Post Reply
ez2cwhy
Posts: 5
Joined: 24 Oct 2011, 12:56

27 Oct 2011, 13:51

Apparently, a dynamically created Menubar does not preserve the order in which items/submenus are added to it. It seems as if submenus are ALWAYS listed before menu items. This is a significant bug, as menu ordering is paramount to the usability of a page. Here's an example:

Code: Select all

        ...
        model = new DefaultMenuModel(); 
        model.addMenuItem(getMenuItem("Home", "centerPanel,menubar"));
        model.addMenuItem(getMenuItem("Overview", "centerPanel,menubar"));
        Submenu subMenu = new Submenu();
        subMenu.setValueExpression("label", this.genPageValExpression("config"));
        MenuItem item = new MenuItem();
        item = new MenuItem();  
        item.setValue("Dynamic Menuitem 2.1");  
        item.setUrl("#");  
        subMenu.getChildren().add(item); 
        model.addSubmenu(subMenu);
        model.addMenuItem(getMenuItem("perform", "centerPanel,menubar"));
        model.addMenuItem(getMenuItem("admin", "centerPanel,menubar"));
        model.addMenuItem(getMenuItem("help", "centerPanel,menubar"));
        ...
This should produce a menu with ordering like so:
  • --Home
    --Overview
    --Configuration
    ----Dynamic Menuitem 2.1
    --Performance
    --Administration
    --Help
Unfortunately though, the Configuration submenu is displayed first:
  • --Configuration
    ----Dynamic Menuitem 2.1
    --Home
    --Overview
    --Performance
    --Administration
    --Help
This has been reported previously:

viewtopic.php?f=3&t=13041
viewtopic.php?f=3&t=7789


One possible workaround would be to NOT use a dynamically created menubar, but instead dynamically create the submenu items; however when that approach was previously suggested, Catagay said not to do it:

viewtopic.php?f=3&t=7502

Here's a link of a suggested fix to PF to correct this:

viewtopic.php?f=3&t=10162

And finally, here's a ticket that was filed:

http://code.google.com/p/primefaces/iss ... il?id=2022

So, is this being looked at? I'm not sure how to proceed as I'd much rather go the route of a menu model, but if it's not going to be fixed anytime soon, then perhaps I'll have to choose another route.

Thanks for the great framework though. Overall, I've loved my exposure so far.
PrimeFaces 3.0.M3, Apache MyFaces 2.1.3, Tomcat 7, Windows XP, Eclipse Indigo

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 27 guests