The redirect works (firefox pops up the filedownload window)
the problem is since I'm not actually redirected to a page (I get a file
instead) I stay on the same page with the links but the links do not
work anymore.
If I click on them I get 'Channel busy - postponing'.
I'm using wicket 1.3.4.
The redirect seems to happen, but only once.
Say there are 3 files to download on the page, I would need to:
click link1 -> download the file -> refresh the page -> click link2 -. etc.
I shouldn't need to refresh the page.
If I don't refresh the page, when I click link2 I'll get 'Channel busy -
postponing'.
BTW:
On the first link click in firebug I get this in the response headers:
Ajax-Location ../../../../fileDownload?type=RUN_REGION_READS_FILE&id=246
which makes sens since the QueryStringUrlCodingStrategy is mounted on
'fileDownload'.
Louis
Matej Knopp wrote:
For some reason the redirect didn't happen. What wicket version are you
using?
-Matej
On Tue, Sep 16, 2008 at 5:43 PM, Louis Letourneau <
[EMAIL PROTECTED]> wrote:
When I click on an AjaxLink that does a setResponsePage towards a
ResourceStreamRequestTarget, afetr the download, the links on the page
become non-clickable. In the Ajax debug window I get a 'Channel busy -
postponing'.
Details:
I have a page with many AjaxLinks. The links check whether some data is
available. If the data is available it does a setResponsePage towards a
BookmarkablePage that can work with the data.
The Page that handles the data is mounted on a 'custom'
QueryStringUrlCodingStrategy. In 'decode()' the strategy checks if
manipulations are needed. If not the strategy answers with a
ResourceStreamRequestTarget.
So here's the path that causes the error:
onClick->setResponsePage->decode->ResourceStreamRequestTarget
Once a link has been clicked no other links are clickable on the page.
AjaxLink Code:
-------------------------------------------->
public void onClick(AjaxRequestTarget target)
{
if(file.isOnline()) {
PageParameters params = new PageParameters();
params.add("id", String.valueOf(typeId));
params.add("type", type.toString());
setResponsePage(StageableFilePage.class, params);
}
else {
modal.show(target);
}
}
-------------------------------------------->
QueryStringUrlCodingStrategy Code:
-------------------------------------------->
public IRequestTarget decode(RequestParameters requestParameters) {
[..get id and fileType and make sure the user has priviledges..]
final StageableFile file = resolveFile(id, fileType);
if(file.isOnline()) {
IResourceStream resourceStream = new FileResourceStream(file);
//Content-type will be set by the ResourceStreamRequestTarget
ResourceStreamRequestTarget rsrt = new
ResourceStreamRequestTarget(resourceStream) {
@Override
public String getFileName() {
return file.getName();
}
};
return rsrt;
}
else {
return super.decode(requestParameters);
}
}
-------------------------------------------->
Any clues?
Louis
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]