There is a logic in my project: whenever I click button, it starts downloading file and closes window it is on. So the button is being detached from document also. At the same time component connector is removing iframe, being used as stream download link. So it dissapears faster then the download process begun if i’m downloading file from distant server.
@Override
public void setParent(ServerConnector parent) {
super.setParent(parent);
if (parent == null && iframe != null) {
//The place where iframe is being detached when the component is detached
iframe.removeFromParent();
}
}
Quick fix idea I can imagine is to leave the iframe where it is, and remove it whenever we click
public void onClick(ClickEvent event)
event.