I want the user to download a generated file, depending on the form content,
with a submit button.

This is how I add the button to the form:
<code>
Button downloadInvoicesButton = new Button("download") {
        @Override
        public void onSubmit() {
                getRequestCycle().replaceAllRequestHandlers(
                                new ResourceReferenceRequestHandler(
                                                new 
ZippedDocumentsResourceReference("Blahblah.zip", documentModel)
                                                ));
        };
};
form.add(downloadInvoicesButton);
</code>

This works, however, the filename and MIME type are incorrect: the response
header is not set accordingly. I would expect that to be done by the
ResourceReference (ZippedDocumentsResourceReference extends
ResourceReference).

Is my assumption incorrect or is this a bug? Can anyone explain why this is
not working?

Thanks,

Roy



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Response-header-is-not-set-by-the-resourcereference-when-changing-the-request-handler-tp4660487.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]

Reply via email to