3 Replies Latest reply on Jun 19, 2007 10:11 AM by phantom

    panelBar view restore.

    phantom

      Good day,

      Please help me with my problem.

      The problem is:
      I use "panelBar" to make a menu on my site. Component renered perfect: I can open subpanels, click on "commandLink" on them, todo some actions and so on. But if I will be redirected to another page the view (or state) of my menu cleared. I mean, that all items collapsed and there is no active menu item what had been clicked.
      How can I realise a component view saving for example in session? I mean, If I click on the same item I want to see this item opened after refresh.

      Please help me!

      Code:

      <h:panelGrid xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:t="http://myfaces.apache.org/tomahawk"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich">
       <h:outputText value="SiteLogo"/>
       <h:form>
       <rich:panelBar id="mb" width="100%" height="100%" binding="#{menuholder.state}" value="#{menuholder.state}">
       <rich:panelBarItem label="#{application['menu.drivers']}">
       <t:commandLink action="driverall" value="driverall"/>
       <t:commandLink action="driveronline" value="driveronline"/>
       </rich:panelBarItem>
       <rich:panelBarItem label="Test">
       <t:commandLink action="driverall" value="driverall"/>
       <t:commandLink action="driveronline" value="driveronline"/>
       </rich:panelBarItem>
       </rich:panelBar>
       </h:form>
      </h:panelGrid>
      
      pages.xml (I'm using Jboss-Seam):
      
      <page view-id="/*">
       <navigation from-action="driverall">
       <render view-id="/driverall.xhtml"/>
       </navigation>
       </page>
      


      As you can see a have only one navigation case for "driverall". And if I select "driveronline" from the second subpanel all is OK, but if I select "driverall" after refresh of the page there is only first (not second) subpanel would be opened.

      Please say me how I can save a state of this component in session context?



        • 1. Re: panelBar view restore.
          ilya_shaikovsky

          http://jira.jboss.com/jira/browse/RF-20 - already planned. You may vote for.

          And one more good news. Works under PanelMenuItem - almost finished. It has built in functional you need. You may check the code from SVN and build it to try.

          • 2. Re: panelBar view restore.
            phantom

             

            "ilya_shaikovsky" wrote:
            http://jira.jboss.com/jira/browse/RF-20 - already planned. You may vote for.

            And one more good news. Works under PanelMenuItem - almost finished. It has built in functional you need. You may check the code from SVN and build it to try.


            Thank you, Ilya, for your answer.
            But if understood correctly, the main idea is to set the id if default opened subpanel. That means that I should have several actions to store the selected subpanel for further using in backing bean. May be it is more convinient to store selected subpanel in value binding EL?

            For example if I have the following code:


            <rich:panelBar value="#{mybean.selected}>
            ...
            </rich:panelBar>
            


            That means, that after redirecting to another page with the same component in mybean.selected I would have the selected subpanel just before redirecting?

            • 3. Re: panelBar view restore.
              phantom

              I cann't understad the difference:

              1) If I click on driveronline on the second subpanel, I have the correct behavier: after refreshing I have the same (second) subpanel opened.
              2) If I click on driverall on the second subpanel, after refresh I have first subpanel opened.