Accordion Tab Click Listener

Hello I am new to vaadin,

I am trying to accordion component for my vertical menu. Bu I have a problem about click listener.
I can call click event for sub menu buttons (Accordion-AccordionTab(Vlayout)-Native Buttons)
But Actually I could not find how to get which event fire when I click Accordion-Tab-Caption…??


Captions are generally not included when it comes to Standard ClickListeners of Components.
If you really need to capture clicks on the caption you could
1: Easy but maybe a bit overkill: add a LayoutClickListener to the surrounding Layout (maybe even wrap the Accordion in an extra layout). This ClickListener should capture all clicks on the components inside the layout and the event should also contain information about what component was clicked.
2: Not easy for a beginner but probably better performing: You could make a component extension (probably also including Javascript code) to attach an additional CaptionClickListener type thing to the caption of the component.

Thanks Marius,

I want to try second option but Could you explain a little more?

Hi, sorry for using this thread to explain my doubt. I have almost the same problem, the thing I want to do is refresh data when clicking a previous selected tab . as you may know when you click a tab which is already selected a selectedtab change event isn’t fired. I’ve tried to wrap the accordion around a vertical layout and then catch the click inside. Apparently the selected tab change event occurs after the layout click, therefore I don’t know what is the currently click tab… Is there any way of doing this perhaps with a custom widget ? Could you please explain a little bit more about this ?

Best regards,
Ivan Frias