Accordion default tab exansion

Hi Vaadin,
I am using Accordion in my project. By default first tab is expanded when page is refreshed. But I want a tab to be expanded only when it is clicked. Is there any way to achieve this?
13105.png

You should be able to use Accordion.select(Tab) , Accordion.deselect(Tab) and Accordion.getSelectedTabs() to achieve what you’re trying to do.

I am using Vaadin 7 and not able to find deselect method. Can you please tell me how to collapse or deselect a tab?

I don’t think there is a way to have all tabs collapsed when created. The only thing you can do is to select a tab using setSelectedTab() and get the selected tabs using getSelectedTabs().
Maybe you try creating an empty tab and selecting this one in the beginning. This way it maybe look like everything is collapsed at first.

The current versions of TabSheet and Accordion do not allow all tabs to be unselected at the same time. Calling e.g. setSelectedTab(null) is ignored and does not change the selection.

You could
create an enhancement request
if you feel this feature should be added to Accordion in some future version of Vaadin. This is somewhat related to
#6746
about allowing multiple tabs of an accordion to be open simultaneously.

Try this maybe

https://vaadin.com/directory#!addon/stackpanel-extension-for-vaadin