Update component after file download

后端 未结 3 464
不知归路
不知归路 2020-12-05 15:41

I\'m using Primefaces TabView, CommandButton and FileDownload to download a log file. Once the log file has been downloaded, I want to offer the option to delete the content

3条回答
  •  情歌与酒
    2020-12-05 16:30

    p:commandButton in your case is (an has to be) non-AJAX button (you set this by adding ajax="false" attribute). In that case update attribute and p:ajax tag doesn't have any sense (as they are only for AJAX requests). When you have file download your application sends streaming of some type, and you see Save File dialog. Your page is not refreshed. So you have to use PrimeFaces.monitorDownload to do this:

    
    

    and add stop function which will update second button:

    
    

提交回复
热议问题