you cannot stream back from ajax request directly, instead try doing something like
window.location=somedownloadurl for ajax requests; -igor On 8/21/07, Martin Bednář <[EMAIL PROTECTED]> wrote: > > Hi, > I have problem when I use IndicatingAjaxSubmitButton for dowload after > form submission. > > I use this code, normal Button working correctly. it's bug in > IndicatingAjaxSubmitButton or I'm doing something wrong ? > > ... > > //This dosn't work > form.add(new IndicatingAjaxSubmitButton("submit", form) { > @Override > protected void onSubmit(AjaxRequestTarget target, Form form) > { > processSubmit(); } > }); > //This working > form.add(new Button("submit") { > @Override > protected void onSubmit() { > processSubmit(); > } > }); > > > > > private void processSubmit() { > final String zipArchiveFilename = "/tmp/sample.zip"; > RequestCycle requestCycle = this.getRequestCycle(); > > final ResourceStreamRequestTarget exportTarget = new > ResourceStreamRequestTarget( > new FileResourceStream(new wicket.util.file.File( > zipArchiveFilename)), "application/zip") { > @Override > protected void configure(Response arg0, IResourceStream arg1) { > super.configure(arg0, arg1); > WebResponse response = (WebResponse) arg0; > setFileName("sample.zip"); > } > }; > > requestCycle.setRequestTarget(exportTarget); > } > >