hi, im trying to use this in a grid and the stream/file is from a blob fiel

hi, im trying to use this in a grid and the stream/file is from a blob field in a database. Im trying this:

    grid.addColumn(new ComponentRenderer<Component, KundeFilePO>(kundeFilePO -> {
        Button button = new Button("");
        button.setIcon(new Icon(VaadinIcon.FILE));
        FileDownloadWrapper buttonWrapper = new FileDownloadWrapper(
                new StreamResource(kundeFilePO.getFilename(), () -> KundeFileService.getBlob(kundeFilePO)));
        buttonWrapper.wrapComponent(button);
        return button;
    }))

it shows the button but pressing the button does nothing.

the method getBlob returns a InputStream from the database.

This is wrong how :) ?

return button;

should be :

return buttonWrapped;

:) now my problem is the contant, say a PDF is opened in the samme window/tab so my app is cone. How can I force it to open in a new window?

By default, it should download the file, not open it in the browser (and this is how it works in my test). Maybe it’s a browser setting? Is your browser set to be the default viewer for .pdf files?