MenuModel issue

UI Components for JSF
Post Reply
igorcc
Posts: 33
Joined: 03 Sep 2009, 13:13

06 Aug 2010, 11:52

Dear All,

When I add a menu item to a menu model I receive the following message:
java.lang.ClassCastException: org.primefaces.component.menuitem.MenuItem cannot be cast to org.primefaces.component.submenu.Submenu
Below is the code:

Code: Select all

private MenuModel menuModel;
...
MenuItem logout = new MenuItem();
logout.setValue("Logout");
...
menuModel.addMenuItem(logout);
PrimeFaces version is 1.1

Where am I wrong? Any thoughts? Thanks!

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Aug 2010, 20:34

Hi,

Which menu component is this?

igorcc
Posts: 33
Joined: 03 Sep 2009, 13:13

08 Aug 2010, 19:34

I used PrimeFaces Menu <p:menu widgetVar="tieredMenu" context="'start','tl','br'" tiered="true" style="width:240px" model="#{menuBean.menuModel}"/> component.
menuBean's menuModel is a org.primefaces.model.DefaultMenuModel object.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests