Hi there,

I'm sorry for sending two email the same day, but i've got a problem that is very strange for me. I'm using wicket 1.3.4 with the patch WICKET-1838 provided by Matej Knopp and i'm testing the page on firefox 3.0.4.

When i click on an ajax link that generates a pdf, the file correctly shows to the user but the mouse is in "waiting state" and in the ajax debug window i've got ajax blocked in "invoking pre-call handler".
Here the log:

INFO: Using XMLHttpRequest transport
INFO:
INFO: Initiating Ajax GET request on ?wicket:interface=:3:table::IActivePageBehaviorListener:3:&wicket:ignoreIfNotActive=true&action=Stampa&targetId=table&contextMenuId=menu&random=0.7506497972643358
INFO: Invoking pre-call handler(s)...


When i click on the ajax link the following code is executed:
...

        PageParameters params = new PageParameters();
        params.add("file", "/home/eg/test.pdf");
        setResponsePage(FakePageForAjaxPrint.class, params);
...


The FakePageForAjaxPrint is an empty page mounted on a specific QueryStringUrlCodingStrategy that in the "decode" method does the following:


    public IRequestTarget decode(RequestParameters requestParameters) {
String filename = ((String[]) requestParameters.getParameters().get("file"))[0];

        final File file = new File(filename);
        IResourceStream resourceStream = new FileResourceStream(file);

ResourceStreamRequestTarget rsrt = new ResourceStreamRequestTarget(resourceStream) {
                @Override
                public String getFileName() {
                        return file.getName();
                }
        };
        try {
                        resourceStream.close();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        return rsrt;
    }


So, when the link is clicked the pdf is showed in the download window of the browser, but the ajax is blocked in "Invoking pre-call handler(s)..." and the mouse pointer is in loading state. I can click as many times i want in the ajax link and the pdf is always showed to the user.

How can i complete the ajax response ?


Sorry for the long email,
Thanks,
Emanuele



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to