Multiple pictures display, slide show of pictures

In CUBA, Can I embed more than one picture and show them one by one or slide show which is typically used in product catalogs?


As the simplest solution, you can use Embedded component and set new image by clicking on buttons or by a timer.

For example:

<hbox id="sliderBox" spacing="true">
    <linkButton id="prevBtn" icon="font-icon:CARET_LEFT" 
                             invoke="prevImage" align="MIDDLE_LEFT"/>
    <embedded id="image" width="480px" height="270px"/>
    <linkButton id="nextBtn" icon="font-icon:CARET_RIGHT" 
                             invoke="nexImage" align="MIDDLE_RIGHT"/>

private Embedded image;

private List<String> images = Arrays.asList(

private int index = 0;

public void init(Map<String, Object> params) {

private void updateImage() {

public void prevImage() {
    index = --index >= 0 ? index : images.size() - 1;

public void nexImage() {
    index = ++index < images.size() ? index : 0;

In this sample, I use images from theme resources, but with Embedded component you can use URL and FileDescriptiors.

You can use some JavaScript Slider component to show images from theme resources. Or you can use some Vaadin add-on for that purpose.

The full source code of my sample hosted on github.



Thank you Gleb. Do you mind showing how to use image files from database in this slider?
Say for example, i have an entity name Product and image entity ProductImages that holds multiple image of the product.