Window with Tabsheet and Paintable.RepaintRequestListener can't be hidden

I have a window with tab sheet component and button which set window visible to false.

Also window has a Paintable.RepaintRequestListener() with overrided method repaintRequested(Paintable.RepaintRequestEvent event).

Code sample is:

import com.vaadin.Application;
import com.vaadin.terminal.Paintable;
import com.vaadin.ui.*;


  • @author Dmitriy SLOBODYANIK
    public class ApplicationWithTabs extends Application {

    public void init() {

     final VerticalLayout main = new VerticalLayout();
     final Window windowWithTabs = new Window("Window with tab sheet component");
     TabSheet tabs = new TabSheet();
     tabs.addTab(new Label("Test tab 1")).setCaption("Tab 1");
     tabs.addTab(new Label("Test tab 2")).setCaption("Tab 2");
     Button hideButton = new Button("Press to hide window");
     hideButton.addListener(new Button.ClickListener() {
         public void buttonClick(Button.ClickEvent event) {
     Button restoreButton = new Button("Press to restore window");
     restoreButton.addListener(new Button.ClickListener() {
         public void buttonClick(Button.ClickEvent event) {
     windowWithTabs.addListener(new Paintable.RepaintRequestListener() {
         public void repaintRequested(Paintable.RepaintRequestEvent event) {
     setMainWindow(new Window("Main window"));



  • open window;
  • select other tab;
  • press hide button;

Window is still visible and you have to refresh a page (F5) to hide it. If you remove RepaintRequestListener it works!

Does anybody know how to fix it?

Have you tried calling super.repaintRequested()?