3 Replies Latest reply on May 11, 2008 11:12 PM by astarte

    togglePanel initState use

      Hello I have a jsp page that contains the following (simplified) standard toggle panel code

      <rich:togglePanel initialState="tip0" switchType="client" stateOrder="tip0,tip1,tip2">
      <f:facet name="tip0">
      ..... some stuff .....
      </f:facet>
      <f:facet name="tip1">
      ......some stuff .....
      </f:facet>
      <f:facet name="tip2">
      ......some stuff .....
      </f:facet>
      </rich:togglePanel>
      I'd like to be able to set the initialState depending on where I am navigating to this page from.
      I've tried a number of things, including simply setting a param
      earlier in the page as such
      <f:param name="togis" value="tip2"/>
      and then
      <rich:togglePanel initialState="#{togis}" switchType="client" stateOrder="tip0,tip1,tip2">
      just to see if I could make it work, but it still defaults to the first facet.
      I am totally new to jsp/jsf programming, so it may be that I am missing something very obvious?
      Thank you
      Gaby

        • 1. Re: togglePanel initState use
          ma.aqcon

          Page flow control (where i am, where i am coming from) is a big gap in JSF. To control that you need an additional framework like Apache Shale or JBoss Seam.

          But there might be a workaroung which helps you without using one of the additions:
          Create an attribute in your backing bean

          private String initialTogglePanel;
          ...
          

          and use this in your page:
          <rich:togglePanel initialState="#{BackingBean.initialTogglePanel}"
          


          Set the value of initialTogglePanel in your action method which is called from your previous page, e.g.
          public String moveToTogglePage() {
           initialTogglePanel = "tip1";
           return "action_to_toggle_page";
          }
          


          Hope that helps!

          • 2. Re: togglePanel initState use

            Thanx for the tip, I figured I would have to use a backing bean. The refeering page currently navigates via an image map, I am not sure how I would implement the backing bean setting call into that?

            • 3. Re: togglePanel initState use

              Figured it out!