Customizing the execution of <af:fileDownloadActionListener> to validate user input
Let me explain an interesting use case on 'file downloading' and a possible solution at this time. Requirement is to accept user input and validate the same, before initiating the file download. If the validation fails, then file download should get suspended. ADF Faces recommends to use <af:fileDownloadActionListener> for downloading file. This provides a declarative solution for the problem, in most of the cases. As you can see from tag documentation, <af:fileDownloadActionListener> is designed in a very generic way. Currently we don’t have any direct mechanism to intercept the invocation of fileDownloadActionListener, apparently solution for the above mentioned use case turns out to be bit tricky. (Thanks to Jeanne Waldman for sharing this idea ) Interesting part of the solutions is queuing the ActionEvent for a ‘hidden’ action component which wraps fileDownloadActionListener. The java script method to queue ActionEvent is invoked from second button’s (th...