1 of 1 people found this helpful
I'm afraid this is not possible. Because when you use h:commandButton you send some specital headers with response and that's why browser opens your resonse as a workbook in Excel. But you can't possibly open a workbook inside your html page. I think you have only one option you should use some JS components which look like Excel. See http://www.treegrid.com/treegrid/www/ for example. I'm sorry if I disappointed you.
P.S. May be folks have other opinions.
Ilya is right, you can't use ajax controls to initiate downloads, excel's PDF's and so on passing to client. So you have to use h:commandButton and probably trigger some indication using its onclick.
Many thanks for looking at this! I travelled down the alternate road by triggering a modal panel using an a4j:support because the h:commandButton does not support oncomplete. The problem is the response never triggers the oncomplete, probably because the export action forced the reponse complete. The best solution I came up with is to allow the user to close the modal panel manually which means they can start firing other events before the export is complete which is what I was hoping to prevent. Que sera sera
Thanks for the help.