Professional Documents
Culture Documents
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
DRAGDROP
Draggable
DataView
download.xhtml FileDownloadView.java
DataTable
Custom
1 <script>
2 //<![CDATA[
CLIENT SIDE VALIDATION 3 function start() {
4 PF('statusDialog').show();
Basic 5 }
Bean 6
7 function stop() {
Custom 8 PF('statusDialog').hide();
9 }
Event
10 //]]>
11 </script>
DIALOG FRAMEWORK 12
13 <div class="card">
Basic 14 <p:dialog modal="true" widgetVar="statusDialog" header="Status" draggable="false" closable="false"
15 resizable="false">
Data 16 <i class="pi pi-spinner pi-spin" style="font-size:3rem"></i>
17 </p:dialog>
18
19 <h:form>
20 <p:commandButton value="Download" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop);"
21 icon="pi pi-arrow-down" styleClass="mr-2">
22 <p:fileDownload value="#{fileDownloadView.file}"/>
23 </p:commandButton>
24
25 <p:commandButton value="Ajax Download" icon="pi pi-arrow-down" styleClass="ui-button-outlined">
26 <p:fileDownload value="#{fileDownloadView.file}"/>
27 </p:commandButton>
28 </h:form>
29 </div>