I would like to use a Dojo button to download an Excel or a PDF file. So far I've managed to do it by using a call to dojo.io.iframe
in the onClick
handler of the button. However, this will only download the file once. Any successive calls will be ignored.
This is the call:
function exportToExcel() {
dojo.io.iframe.send({
url: '/report/export',
handleAs: 'xml',
content: {
__export: 'excel'
}
});
}
As if the dojo.io.iframe
does not consider the previous request to be completed.
What am I doing wrong?