Search code examples
jsf-2richfaces

How to store state of rich:accordian item?


I want to make navigation page like http://showcase.richfaces.org/ using rich accordian. I want the user to be able to save state of rich accordian as in demo by exadel when user clicks the link. How can I achieve this behaviour? Using Richfaces 4.

<rich:accordion switchType="ajax">
                            <rich:accordionItem header="Daily Sales" >                           
                                <h:outputLink value="../GKPI/R.xhtml">1. R</h:outputLink> <br></br>                                                              
                            </rich:accordionItem>

                            <rich:accordionItem  header="Weekly Sales" > 
                                <h:outputLink value="../GKPIW/CR.xhtml">1. CR</h:outputLink> <br></br>                              
                            </rich:accordionItem>
  </rich:accordion>

Solution

  • The solution was to add activeItem="#{bean.activeItem}" where activeItem is string variable in managed bean.

    <rich:accordion switchType="ajax" activeItem="#{kpilist.activeItem}" >
    </rich:accordion>