Maybe this might help http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
<http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html> Ernesto On Tue, Oct 20, 2009 at 10:12 PM, tubin gen <[email protected]> wrote: > I do download in traditional way > > here is the code > > public void download(String filename, byte[] filedata){ > setRedirect(false); > WebResponse response = (WebResponse) getResponse(); > response.setAttachmentHeader(filename); > response.setLastModifiedTime(Time.now()); > response.setContentType("application/octet-stream"); > response.write( > new ByteArrayInputStream(filedata)); > response.close(); > } > > > item.add(new Link<Void>("download"){ > { > add(new Label("filename", > eaAuditProgramAttachment.getFileName())); > } > @Override > public void onClick() { > > ((BasePage)getPage()).download(eaAuditProgramAttachment.getFileName(), > eaAuditProgramAttachment.getEaBlob().getBlobData()); > } > }); > > > If I replace this link with AjaxLink it will not work and I must use an > ajaxlink please tell me how can I use ajaxLink for download >
