Zakon
Zakon

Reputation: 81

Vaadin Layout dont Diaply Buttons

Hi am usin Vaadin to code an WebApplication. I use this Vaadin Addon: https://vaadin.com/directory/component/carousel-addon

My Problem is that my Button layout only display on the 3rd Carousel Slide and i dont know why.

private Component crateCarouselSlides(Image iconimage, H1 header, Label infoText) {
    HorizontalLayout buttonLayout = new HorizontalLayout(previousSlideButton,nextSlideButton);
    if(infoText != null){
        VerticalLayout slideLayout = new VerticalLayout(iconimage,header,infoText,buttonLayout);
        slideLayout.setClassName("slideLayout");
        iconimage.setClassName("iconImage");
        return slideLayout;
    }else{
        HorizontalLayout textFields = new HorizontalLayout(new TextField("Name"),new TextField("Playlist"));
        VerticalLayout slideLayout = new VerticalLayout(iconimage,header,textFields,buttonLayout);
        slideLayout.setClassName("slideLayout");
        iconimage.setClassName("iconImage");
        return slideLayout;
    }
}

Thanks for your Help. :)

Slide1 Slide3

Upvotes: 0

Views: 70

Answers (2)

Zakon
Zakon

Reputation: 81

After long debugging finally the solution. A button can only be on one slide at a time. If buttons are added to multiple slides, the button is only displayed on the last one. I did not find out why. Temporarily I will create a new button for each slide. Not nice to read but it works for now.

Upvotes: 0

WaTho
WaTho

Reputation: 41

Could it be that your Label infoText takes more vertical space than your HorizontalLayout textFields in the second case and therefore the buttonLayout is just out of view?

I know that this is no real answer. I tried to add this as comment, but i don't have enough reputation.

Upvotes: 0

Related Questions