Problems with dynamic richfaces dropDownMenu
alexeicu Nov 19, 2009 4:25 PMHi, I'm building a dynamic dropDownMenu, this my code.
a sessionAdmin component to manage de session user, it include an instance of MenuManager
@Name("sessionAdmin") @Scope(ScopeType.SESSION) @Startup public class SessionManager { MenuManager menuManager = new MenuManager(); ... setter and getter
the MenuManager class is:
public class MenuManager { private List<HtmlDropDownMenu> menuList = new ArrayList(); ... protected HtmlDropDownMenu builtDropDownMenu(String label) { HtmlDropDownMenu dropDownMenu = new HtmlDropDownMenu(); dropDownMenu.setValue(label); //build the menuItems and add to dropDownMenu ... return dropDownMenu; } ... protected HtmlMenuItem builtMenuItem(String label, String url) { HtmlMenuItem menuItem = new HtmlMenuItem(); HtmlOutputLink outPutLink = new HtmlOutputLink(); outPutLink.setValue(url); menuItem.getChildren().add(outPutLink); HtmlOutputText outPutText = new HtmlOutputText(); outPutText.setValue(label); outPutLink.getChildren().add(outPutText); return menuItem; }
When I authenticate the user I call a method that fill the menuList.
This is my menu.xhtml
<c:forEach items="#{sessionAdmin.menuManager.menuList}"var="menuItem"> <rich:dropDownMenu binding="#{menuItem}"/> </c:forEach>
the menu is bulding ok, but when I click in the item, I got these error.
10:16:16,184 ERROR [lifecycle] JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: /pages/home.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@11746a] 10:16:16,227 WARN [ExceptionFilter] handling uncaught exception javax.servlet.ServletException: /WEB-INF/incl/menu.xhtml @12,47 binding="#{menuItem}": /WEB-INF/incl/menu.xhtml @10,75 items="#{sessionAdmin.menuManager.menuList}": Error reading 'menuManager' on type seamsandbox.buslogic.appmanager.SessionManager_$$_javassist_1 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277) ... Caused by: javax.el.PropertyNotFoundException: Property 'statusMessages' not found on type org.jboss.seam.Namespace ...
I don't know why it can't access the menuManager property of sessionAdmin component when I click int the menu item link, what is wrong ?