Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How to implement collapsible panels ?

Guy DS
1 decade ago Jan 13, 2010 4:24pm
Bruno Pinto
1 decade ago Jan 13, 2010 6:32pm
Guy DS
1 decade ago Jan 13, 2010 9:08pm
Kim Leppänen
1 decade ago Jan 14, 2010 6:21am
Guy DS
1 decade ago Jan 16, 2010 9:45am
Jens Jansson
1 decade ago Jan 16, 2010 10:48am

If the animation is not the most important part then how about just making a server side component that does about what you are looking for?

VerticalLayout mainLayout = new VerticalLayout();
VerticalLayout hiddenContent = new VerticalLayout()
// Add your actual conent to the hiddenContent
hiddenContent.addComponent(new Label("Hello world!");
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.addComponent(new Button("Show/Hide",new Button.ClickListener(){
  hiddenContent.setVisible(!hiddenContent.isVisible());
}));
mainLayout.addComponent(buttonLayout);
mainLayout.addComponent(hiddenLayout);
hiddenLayout.setVisible(false);

Note: code written directly to the forum so syntax isn't checked.

Guy DS
1 decade ago Jan 17, 2010 8:22pm
Jouni Koivuviita
1 decade ago Mar 30, 2011 9:57am
Guy DS
1 decade ago Mar 30, 2011 12:09pm
Benjamin Seyinbour
1 decade ago Mar 30, 2011 7:07pm
Jorg Heymans
1 decade ago Mar 30, 2011 7:26pm
Jouni Koivuviita
1 decade ago Mar 30, 2011 7:48pm
Jorg Heymans
1 decade ago Mar 30, 2011 8:15pm