Accordion issue


I have an issue with accordions. I would like to have only one accordion open at a time. When we open next the other one should be closed.

In .rp file:

  1. example
    I can’t add a second state to the heading view.

  2. example
    I have two states but when I open an accordion I have large spaces between them.

Could you help and advise me what I do wrong?

Accordion examples.rp (2.1 MB)


I’m not sure i understand your question/problem. Are you simply saying that because each accordion item is a group you can’t add a second state to a group? Well, that’s true. But, you can create a dynamic panel from this group and then add more states to that.

This is because you need to add the “push/pull widgets below” option to all the Set State actions. For example, in each “Default” state you have a hotpsot with three Set State actions, but the latter two don’t “push/pull widgets”, which is the main cause of your large spaces. It will also help if you reverse the order of these actions, setting the other accordion items to Default first, then setting the state of the current accordion item to “Content”. Otherwise, you’d probably need to add a Wait action after each Set State action to accommodate for the 400ms it takes for your animation effect (slide down 400ms.) This is because the dynamic panels don’t actually change state until the animation finishes.

Thank you for your tips, mbc66!

The accordion works perfectly now! I used your ideas for the second example!