2 Replies Latest reply on May 19, 2009 9:07 AM by Jesper Vrelits

    How to set selected HtmlPanelMenuItem in code

    Jesper Vrelits Newbie

      Hi! I'm new to RichFaces.
      Managed to build a dynamic PanelMenu in code:

      HtmlPanelMenuItem item = (HtmlPanelMenuItem) ctx.getApplication().createComponent(HtmlPanelMenuItem.COMPONENT_TYPE);
      item.setLabel(label);

      The only problem I have is that I show data for the first menu item, but it is not selected. How do I set the first menu item as selected (cursive font) from code? Tried item.setStyleClass("rich-pmenu-item-selected") but does not seem to work.