4 Replies Latest reply on Oct 22, 2007 12:08 PM by krzysgdynia

    rich:panelMenu

    krzysgdynia

      I want to use panelMenu to navigate between pages. I have a problem with passing active item in panelMenu after page is rendered.
      I tried to use:
      - selectedChild (in panelMenu component)
      - name (in panelMenuGroup and panelMenuItem components)
      - and Stateful bean to remember active item
      but it doesn't work.
      I use Seam2.0.0CR2.

      Below are details:

      <rich:panelMenu style="width: 100%; width:200px; "
      iconExpandedGroup="disc" iconCollapsedGroup="disc"
      iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
      iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right"
      rendered="#{identity.loggedIn}" selectedChild="#{menuRend.activeItem}" expandSingle="true">
      <rich:panelMenuGroup label="#{msg['view.miasta.title']}" name="miasta">
      <rich:panelMenuItem label="#{msg['view.miasta.dodaj']}" action="#{menuRend.addMiasto}" name="addMiasto"/>
      <rich:panelMenuItem label="#{msg['view.miasta.lista']}" action="#{menuRend.showMiasta}" name="showMiasta"/>
      </rich:panelMenuGroup>
      <rich:panelMenuGroup label="#{msg['view.jednostki.title']}" name="jednostki">
      <rich:panelMenuItem label="#{msg['view.jednostki.dodaj']}" action="#{menuRend.addJednostka}" name="addJednostka"/>
      <rich:panelMenuItem label="#{msg['view.jednostki.lista']}" action="#{menuRend.showJednostki}" name="showJednostki"/>
      </rich:panelMenuGroup>
      <rich:panelMenuGroup label="#{msg['view.organProwadzacy.title']}" name="organProwadzacy">
      <rich:panelMenuItem label="#{msg['view.organProwadzacy.dodaj']}" action="#{menuRend.addOrganProwadzacy}" name="addOrganProwadzacy"/>
      <rich:panelMenuItem label="#{msg['view.organProwadzacy.lista']}" action="#{menuRend.showOrganyProwadzace}" name="showOrganyProwadzace"/>
      </rich:panelMenuGroup>
      </rich:panelMenu>



      @Name("menuRend")
      @Stateful
      public class MenuRendering implements IMenuRendering {

      private String activeItem;

      public String getActiveItem() {
      return activeItem;
      }

      public String showMiasta(){
      this.activeItem = "showMiasta";
      return "/miasta/MiastaList.xhtml";
      }

      public String addMiasto(){
      this.activeItem = "addMiasto";
      return "/miasta/MiastaEdit.xhtml";
      }

      public String showJednostki() {
      this.activeItem = "showJednostki";
      return "/jednostki/JednostkiList.xhtml";

      }

      public String addJednostka() {
      this.activeItem = "addJednostka";
      return "/jednostki/JednostkiEdit.xhtml";

      }

      .........
      }

      Thanks for the help
      Chris

        • 1. Re: rich:panelMenu
          krzysgdynia

          Does nobody know how to use selectedChild in rich:panelMenu ?

          • 2. Re: rich:panelMenu
            sdelvalle

            You must set the id for the panelMenuItem tag, and then set that value in the selectedChild attrbute for the panelMenu tag

            • 3. Re: rich:panelMenu
              krzysgdynia

              Thank you for answer but I tried it already.
              Anybody used panelMenu? I don't know what for is selectedChild arribute in panelMenu tag. It doesn't work.
              I try:
              - use id for bind with selectedChild
              - use name for bind with selectedChild
              - I updated richfaces to 3.1.2.GA.
              I read richfaces_reference.pdf and I haven't idea how to use selectedChild ("contain the name or the clientId of any of the item
              or group, the child defined in this attribute should be
              highlighted on PanelMenu rendering" - are you sure????).

              Thanks for any help

              • 4. Re: rich:panelMenu
                krzysgdynia

                I found solution by set expanded (panelMenuGroup, itemMenu) and selectedChild (panelMenu).