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

    How to set selected HtmlPanelMenuItem in code

    vrelits

      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.