2 Replies Latest reply on Nov 27, 2009 11:57 PM by jsfgeeks

    Panel Menu with dyanmic  expanded problem

    jsfgeeks

      hi,
      In my project i use Panel Menu for different topic listing of different category. for dyanmic panel menu group & panel menu item i am using C:for Each & c:if tag. like below

       <c:if test="${contentlist.current_subject==1}">
       <rich:panelMenu selectedChild="#{contentlist.current}"
       style="width:250px;height:600px" expandMode="ajax" mode="ajax" expandSingle="true" id="pnlmenu_phy"
       iconExpandedGroup="disc" iconCollapsedGroup="disc" topItemStyle="color:red;"
       iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
       iconCollapsedTopGroup="chevronDown">
       <c:forEach items="#{contentlist.selectItems_std}" var="std1">
      
       <rich:panelMenuGroup value="#{listState.lststate}" expanded="true" actionListener="#{listState.select}" id="pnlmenugrp_phystd" style="background-color:red" label="#{std1.label}" >
       <h:outputText value="#{listState.lststate}"/>
       <c:forEach items="#{contentlist.selectItems_chap}" var="chap1">
       <c:if test="${chap1.description==std1.value}">
       <rich:panelMenuItem name="#{chap1.value}"
       id="pnlmenuitm_phychap" mode="ajax" ignoreDupResponses="true" ajaxSingle="true" action="#{contentlist.chapterlist_action}" label="#{chap1.label}" >
       <a4j:support id="ajxsprt_phychap" event="onclick" reRender="datagridtopic"></a4j:support >
       <rich:dragSupport id="drgsprt_phychap" dragIndicator=":drgindic"
       dragType="value" dragValue="#{chap1.value}">
       <rich:dndParam id="dndprm_phychap" name="label" value="#{chap1.label}" />
       </rich:dragSupport>
       <f:param id="fprm_phychap" name="current" value="#{chap1.value}"/>
       </rich:panelMenuItem>
       </c:if>
       </c:forEach>
       </rich:panelMenuGroup>
       </c:forEach>
       </rich:panelMenu>
       </c:if>
      

      Everything is working fine.
      now my problem is i am using datagrid which is get rendered as user clicks on panel meu items & there are links on datagrid rows.
      when user clicks on that links & come back to this page i want to maintain state of Panelmenu & panel menu group.
      suppose i have selected Group2 >item4 then when back from redirect it gets selected & expanded.




        • 1. Re: Panel Menu with dyanmic  expanded problem
          ilya_shaikovsky

          you could download sources of richfaces-demo and check how that achieved for left main menu.

          • 2. Re: Panel Menu with dyanmic  expanded problem
            jsfgeeks

            thnaks a lot for your reply,

            can you plz tell where i will get this demo for download.
            and i think they might be using Panel bar not Panel menu and have one solution i got it from Max kartz blog but it's for static menu. he is passing Id of panel menu group in value expression of menugroup like

            value=#{menuState.menu['group1']}
            

            where 'group1' is id of menugroup & this functions maintains the state of menugroups. but i am using c:foreach to iterate for different menugroup & menuitems & even i can not use dynamic id of menu group item like
            id=#{std1.value}
            

            it gives me el expression error.
            i am really stucked at this error and i am tryind to solve it from last 2 days.
            any help will be appreciated.
            thanks