Reputation: 583
onclick of a button creates a window, add to UI, I want to close this window using javascript ? please advice how to close this window using javascript after some timeout?
Button button= new Button("load Content",e->{
Window sub= new Window();
UI.getCurrent().addWindow(sub);
});
Upvotes: 0
Views: 733
Reputation: 26258
Try this:
setTimeout("window.close()", 5000);
// here 5000 ms refers to 5 seconds
Upvotes: 1