How to display menus in panelNavigation2 component

Hi all

I've code for displaying navigation menu on left side. it's working without any error but doesn't display any label/string on the page. What could be missing in my code?

pls help.

I've code like

<t:panelNavigation2 id="menu1" layout="list" binding="#{navigationMenuBean.panelMenu}" >

</t:panelNavigation2>

and

public class NavigationMenuBean {

private List<HtmlCommandNavigationItem> panelList ;

private HtmlPanelNavigationMenu panelMenu;

/**

* @return the panelMenu

*/

@SuppressWarnings("unchecked")

public UIComponent getPanelMenu() {

panelMenu = new HtmlPanelNavigationMenu();

panelMenu.getChildren().addAll(getPanelList());

return panelMenu;

}

/**

* @param panelMenu the panelMenu to set

*/

public void setPanelMenu(UIComponent panelMenu) {

this.panelMenu =(HtmlPanelNavigationMenu) panelMenu;

}

/**

* @return the panelList

*/

public List<HtmlCommandNavigationItem> getPanelList() {

this.panelList = null;

this.panelList = getPanelNavigationItems();

return panelList;

}

/**

* @param panelList the panelList to set

*/

public void setPanelList(List<HtmlCommandNavigationItem> panelList) {

this.panelList = panelList;

}

@SuppressWarnings("unchecked")

public List<HtmlCommandNavigationItem> getPanelNavigationItems() {

UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();

List<HtmlCommandNavigationItem> menu = new ArrayList<HtmlCommandNavigationItem>();

// Products

HtmlCommandNavigationItem products = getMenuNaviagtionItem(root.createUniqueId(),"Menu1", "#{navigationMenu.getAction2}");

products.getChildren().add(getMenuNaviagtionItem(root.createUniqueId(),"Menu2", "#{navigationMenu.getAction2}"));

products.getChildren().add(getMenuNaviagtionItem(root.createUniqueId(),"Menu3", "#{navigationMenu.getAction2}"));

HtmlCommandNavigationItem item = getMenuNaviagtionItem(root.createUniqueId(),"Menu4", "#{navigationMenu.getAction2}");

item.setActive(true);

item.setOpen(true);

item.setTarget("_blank");

item.setId(root.createUniqueId());

products.getChildren().add(item);

menu.add(products);

// Shop

menu.add(getMenuNaviagtionItem(root.createUniqueId(),"Menu5", "#{navigationMenu.getAction2}"));

// Corporate Info

HtmlCommandNavigationItem corporateInfo = getMenuNaviagtionItem(root.createUniqueId(),"Menu6", "#{navigationMenu.getAction2}");

menu.add(corporateInfo);

corporateInfo.getChildren().add(getMenuNaviagtionItem(root.createUniqueId(),"Menu7", "#{navigationMenu.getAction2}"));

item = getMenuNaviagtionItem(root.createUniqueId(),"Menu8", "#{navigationMenu.getAction3}");

//item.setIcon("images/arrow-first.gif");

item.setDisabled(true);

corporateInfo.getChildren().add(item);

// Contact

menu.add(getMenuNaviagtionItem(root.createUniqueId(),"Menu9", "#{navigationMenu.getAction2}"));

// External Link

item = getMenuNaviagtionItem(root.createUniqueId(),"Menu10", "#{navigationMenu.getAction2}");

item.setExternalLink("Menu11");

item.setTarget("_blank");

menu.add(item);

return menu;

}

private static HtmlCommandNavigationItem getMenuNaviagtionItem(String id,String label,String action) {

HtmlCommandNavigationItem item = new HtmlCommandNavigationItem();

FacesContext fc = FacesContext.getCurrentInstance();

Application app = fc.getApplication();

MethodBinding mb = app.createMethodBinding(action,new Class[] {ActionEvent.class});

item.setActionListener(mb);

item.setValue(label);

item.setId(id);

return item;

}

}

[3907 byte] By [Manoj.s.Jaina] at [2007-11-27 9:54:20]
# 1
I got the answer.i used UINavigationMenuItem componentMessage was edited by: Manoj.s.Jain
Manoj.s.Jaina at 2007-7-13 0:24:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...