6 Replies Latest reply on Apr 11, 2008 12:39 PM by Tom ONeill

    Saving state on simpleTogglePanel or panelMenu

    Michael Litherland Newbie

      Hi,

      I've spent most of the day trying to get panelMenu or simpleTogglePanel to remember their state between page views. I've played with code, read the manuals and searched this forum. This is an existing application that I want to integrate RichFaces into, so for the moment I can't muck around too much with page flows. The documentation is pretty confusing, in simpleTogglePanel it mentions a non-existent attributed "expanded" that "could [...] keep a panel state". Then when I tried to do this with panelMenu I found it had a "expanded" attribute that seems to do the same thing that "opened" does for the toggle panel.

      This can't be an uncommon request - I can't have my users resetting their panels as they go around the application. I'm thinking maybe a4j:support could be used to update the boolean backing value when the panel states are toggled, but seeing an example of this in action would be helpful.


      <rich:panelMenuGroup expanded="#{userSession.openedDataExchange}"
      label="Data Exchange Services">


      That value is a boolean, stored in a real simple JSF session bean. Just need a way for the page to update that value when the panel is toggled.

      Thanks much for the help.

      Mike