Hi,
I have a Wizard that is inside a BreadCrumbPanel. I have implemented a
method in the onCancel that goes back to the previous BreadCrumbPanel. This
is how it is implemented:
List<IBreadCrumbParticipant> participants =
crumbModel.allBreadCrumbParticipants();
crumbModel.setActive(participants.get(participants.size() - 2));
This works fine. The problem is in my onFinish. This wizard creates a zip
file that exports some documents from our system. The code for this is
below. I would like the onFinish to send the zip file back to the user and
then return to the previous BreadCrumbPanel. I'm not able to do that with
the code below. Does anyone have any ideas on how to do this?
ResourceStreamRequestHandler target = new ResourceStreamRequestHandler(new
AbstractResourceStreamWriter()
{
public void write(Response response)
{
try
{
ResponseOutputStream out = new ResponseOutputStream(response);
ZipOutputStream zip = new ZipOutputStream(out);
policyService.exportPolicies(zip, policyService.getPolicies());
zip.close();
}
catch(IOException e)
{
throw new RuntimeException("Failed to export all policies.", e);
}
}
@Override
public String getContentType()
{
return "application/zip";
}
});
target.setFileName("All Policies.zip");
getRequestCycle().scheduleRequestHandlerAfterCurrent(target);
List<IBreadCrumbParticipant> participants =
crumbModel.allBreadCrumbParticipants();
crumbModel.setActive(participants.get(participants.size() - 2));
I'm using wicket 1.5.4 by the way.
Thanks,
Josh