You are on page 1of 1

Get Started Themes Templates Resources v12.0.

0-SNAPSHOT

FileDownload
Search by name...
 SERVER API
DragDrop

Chunked FileDownload is used to stream binary contents like files stored in database to the client. FileDownload is used by attaching it to any JSF command component like button or a link. Additionally
presentation of download can be configured with the contentDisposition attribute that takes either "attachment" or "inline" as a value.
Tooltips

Download

 Download  Ajax Download

DRAGDROP 
Draggable

DataView
download.xhtml FileDownloadView.java
DataTable

Custom
1 @Named
2 @RequestScoped
CLIENT SIDE VALIDATION 3 public class FileDownloadView {
4
Basic 5 private StreamedContent file;
Bean 6
7 public FileDownloadView() {
Custom 8 file = DefaultStreamedContent.builder()
9 .name("downloaded_boromir.jpg")
Event
10 .contentType("image/jpg")
11 .stream(() -> FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/resources/demo/images/boromir.jpg"))
DIALOG FRAMEWORK 12 .build();
13 }
Basic 14
15 public StreamedContent getFile() {
Data 16 return file;
17 }
18 }

PrimeFaces 12.0.0 by PrimeTek   

You might also like