Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Page is not responsed after a file is download
Hi, please see the following code:
@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
Button button = new Button("Download");
button.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
StreamResource.StreamSource source = new StreamResource.StreamSource() {
public InputStream getStream() {
byte b = null;
String ppp = "<table><tr><td><span>djfdlkfj</span></td></tr></table>";
b = ppp.getBytes();
return new ByteArrayInputStream(b);
}
};
String namefile = "picture.xls";
StreamResource resource = new StreamResource(source, namefile);
resource.getStream().setParameter("Content-Disposition", "attachment;filename=\"" + namefile + "\"");
resource.setMIMEType("application/xls");
resource.setCacheTime(0);
Page.getCurrent().open(resource, "_self", true);
}
});
layout.addComponent(button);
Button dummy = new Button("Dummy");
dummy.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Notification.show("Dummy button is clicked");
}
});
layout.addComponent(dummy);
}
1. Click button Download, file picture.xls is download.
2. Button Dummy and Download are not responsed any more.
3. Refresh browser, everything is normal.
Is there anything missed when using deprecated method Page.getCurrent().open(...) in Vaddin 7.7.6?
I'm not sure about the Page.open. I would recommend to use FileDownloader https://vaadin.com/api/7.7.6/com/vaadin/server/FileDownloader.html