Loading dynamic data via a Link

Hi

I have this scenario where I am loading PDF documents from a database in two steps:
1/ First I query the database to get a listing of the available PDF documents. The result is displayed in a table where each document is represented as a com.vaadin.ui.Link object.
2/ When the user clicks on the link I will load the PDF document (bytes) from the database and open it in a new window.

The trouble I have is that I can not really figure out how I define the link to use an (internal) dynamic resource as described above.

I have no problems getting Link objects to work using ExternalResource.

Thanks

Jan

Hi,

Instead of using an ExternalResource, you would use a
StreamResource

See
Section 4.5 of the Book Of Vaadin for more detail.

Cheers,

Charles

Thanks, that works :slight_smile: