I have some download implementation which allows me to export all data from a dataTable. When a lot of data is being exported, the user must not press anywhere in the application, because the current export process is getting aborted then and it would crash with some exceptions like “EJB Invocation failed on component…..” or “Could not find XyzBean”.
So my idea is to forbid button presses as long as the download process is in progress. I thought about using a PhaseListener but I’m not sure how to intercept request? The awaited behaviour should be that nothing happens in the GUI when user presses anywhere as long as the download process is in progress. I could set a variable when download has been started and unset it when download has been finished. So I know when to block, but I’m not sure how this blocking could look like. Any ideas?
I’m using JBoss 7.1.1 with RichFaces 4.2.
This solution causes a latch for all buttons in the view, so if a download is in progress and I press any buttons, this request will be discarded. This basically works but I still have some crashes with , but I think this is related to another problem.
In my download method at the beginning I add a flag to the current session:
At the end of the download method I set this flag to false…
In a phase listener (which has been added to faces-config) I check if there is currently a download in progress. If so, discard the request.