I am trying to create a dynamic PanelNavigation Menu using the method utilized in the examples. The problem I am having is that I need my actionListener to be able to access an attribute that identifies the current item and I don't see how to add an attribute to the NavigationMenuItem.

For example, I have the facelet code:

<t:panelNavigation2 id="profileNavigation"
                    layout="list"
                    itemClass="mypage"
                    activeItemClass="selected"
                    disabledStyle="color:red">
   <t:navigationMenuItems id="navitems" value="#{mybean.menuItems}" />
</t:panelNavigation2>



My Bean contains the following Code similar to the following as I have removed a lot of the code to simplify the example:

List<NavigationMenuItems> lMenuItems = new ArrayList<NavigationMenuItem>();
for( Student lStudent : students ) {
NavigationMenuItem lItem = new NavigationMenuItem( lStudent.getName(), "#{myaction}");
   lItem.setActionListener("#{myActionListener}");
   lItem.setValue(lStudent.getName())
}

The problem is that when the user clicks on the menu Item the action listener needs access to two pieces of information: 1) the student and 2) a display mode.

Can anyone tell me what I need to do to set attributes on the components so that I can look them up in the actionListener.

Reply via email to