Sometimes I get it to work, other times not so much, and I can’t seem to figure out the factors at play.
Answers to these two questions would resolve the issue:
- Is there a snippet of a scrollable VerticalLayout implementation?
This is the code I’m using which works sometimes and other times it compresses the items to fit the vertical space without adding a scroll bar.
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
setContent(layout);
layout.setHeight("100%");
VerticalLayout thisshouldnotscroll=new VerticalLayout(); thisshouldnotscroll.setHeight("100%");
thisshouldnotscroll.addComponent(new Label("This should not scroll"));
VerticalLayout thisshouldscroll=new VerticalLayout();
thisshouldscroll.setHeight("100%");
for (int i=0;i<200;i++){thisshouldscroll.addCompoenent(new Label("Item in list"));}
layout.addComponents(thisshouldnotscroll,thisshouldscroll);
- How to you switch from flex to block mode in Vaadin 8?