Works by using AttributeModifier for href. Any objection to use it with AjaxLink ?
Thank you and regards, Igor 2011/8/24 Igor Racic <[email protected]> > Hi, > > It worked in IE7. FF/Chrome option setting to download in fixed directory > played here. I changed to "ask on every download" and now it works (both > ways !). > > Is there a way so that right click propose correct name (currenctly it's > like xyz.htm / xyz.htm.part) ? > > > Thank you and regards, > Igor > > > 2011/8/23 eugenebalt <[email protected]> > >> Igor, >> >> Don't use the AJAXDownload class. There's another way to do it via Ajax, >> and >> get the Save As dialog. >> >> Click this page: >> https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html >> >> Go down to the example that starts with "or do it like this:" (the 2nd >> example in the section "Starting download after form submission (Wicket >> 1.2)") >> >> This example is using the WebResource. >> >> [ WebResource export = new WebResource() { ... etc. ] >> >> Use this WebResource example. Then, add a ResourceLink backed by this >> WebResource. >> >> I followed it directly and it works. I get the Save As... dialog box and >> the >> file bytes are constructed at the time the link is clicked. >> >> CODE: >> ------ >> >> // Export to Spreadsheet Link >> >> // 1. Construct a WebResource from Excel bytes >> WebResource export = new WebResource() >> { >> @Override >> public IResourceStream getResourceStream() { >> ByteArrayResource bar = new >> ByteArrayResource("application/vnd.ms-excel", >> createExcelBytes()); >> return bar.getResourceStream(); >> } >> >> @Override >> protected void setHeaders(WebResponse response) { >> super.setHeaders(response); >> response.setAttachmentHeader("report.xls"); >> } >> }; >> export.setCacheable(false); >> >> // 2. Add a ResourceLink based on the WebResource >> ResourceLink exportLink = new ResourceLink("exportLink", export); >> >> add(exportLink); >> ---------------------- >> >> >> -- >> View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3763726.html >> Sent from the Users forum mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >
