Now in my application I have button which create file for download. Problem is that creating file takes a long time (3s) and file is created again and again when button is pressed. Is there some way to create file asynchronous once when page is rendered and then use this file in DownloadModelLink
?
private void addDownloadButton() {
add(new DownloadModelLink("file", new AbstractReadOnlyModel<File>() {
private static final long serialVersionUID = 1L;
@Override
public File getObject() {
return service.createFile();
}
}));
}