파일을 다운로드해야하기 때문에 약간의 문제가 있습니다. (h : commandButton 만 사용 가능)하지만 oncomplete 함수가 필요합니다 (a4j : commandButton)가 실행 상태로 나타납니다. 코드의 샘플이 있습니다 :h : commandButton oncomplete 함수가 있고 파일을 다운로드하십시오.
<h:commandButton
id="downloadReportButton"
action="#{reportingBean.createAndDonwloadFile()}"
/>
이미 BalusC하여이 응답처럼 수행하려고 : https://stackoverflow.com/a/31267418/1777424하지만 문제는 수행되지 않습니다 Ajax 요청이다.
<h:commandButton
id="downloadReportButton"
action="#{reportingBean.createAndDonwloadFile()}"/>
<f:ajax onevent="oneventFunction" />
</h:commandLink>
function oneventFunction(data) {
if (data.status === "success") {
oncompleteFunction();
}
}