Unable to close Window in 8.0.6 or 8.1.0 RC1

With the following codes, the window can’t be closed:

public class MainEditor extends Window {
private static final long serialVersionUID = 1L;
public MainEditor(UI rootUI) {
super(“Main Editor”);
VerticalLayout subContent = new VerticalLayout();
super.setContent(subContent);
super.setModal(true);
super.setWidth(“200”);
super.setHeight(“200”);
subContent.addComponent(new Button(“Close me”, event → {
close(); // doesn’t work
//UI.getCurrent().removeWindow(this); // doesn’t work
System.out.println(“>>>>>>>>>>>>>>>>>>>closed!”);
}));
}
}

this.me = new MainEditor(UI.getCurrent());
this.layout.addComponent(new Button(“Open Window”, event → {
UI.getCurrent().addWindow(this.me);
}));

  1. Click “open window” to open (1.jpg).
  2. Click “close me” to close, window is still there, but the shade is gone (2.jpg).
  3. Clicking doesn’t work anymore.

Thanks,

33908.jpg
33909.jpg

It works in 7.7.10.

Hi,

I tried to reproduce your isseu but it works just fine for me. Maybe it is a browsers specific issue? What browser and OS are you using?

cheers,
matti

it works for me too, vaadin version 8.0.7 with chrome Versión 59.0.3071.115 (Build oficial) (64 bits) , Ubuntu 15.10

  @Override
    protected void init(VaadinRequest vaadinRequest) {
        final VerticalLayout layout = new VerticalLayout();
    
         MainWindows win = new MainWindows(this);
         layout.addComponents(vendors,products, new Button("Open", e -> {
         UI.getCurrent().addWindow(win);
        }));
        
        setContent(layout);
       
    }
    
    public class MainWindows extends Window {
   
    public MainWindows(UI root) {
     super("Main Window");
     setResizable(false);
     setModal(true);
     setWindowMode(WindowMode.NORMAL);
     setWidth("300px");
     setHeight("300px");
     VerticalLayout layout  = new VerticalLayout();
     super.setContent(layout);
     layout.addComponent(new Button("Close me!!!", e -> {
      close();
      UI.getCurrent().removeWindow(this);
      System.out.println("<<<<<< close");
     }));
    }
    }

OS: Windows 7
Browsers:
IE 11
Firefox
Chrome

Testing for 8.0.2, 8.0.6, and 8.1.0 RC1 gives me the same result.
7.7.10 works in all 3 browsers.

Thanks,

That’s weird. I tried with exactly same set and it works for me. Maybe there is something else involved. Special themeing or other environment issue. Check server log, if there is some hints there and then you can user the debug mode with ?debug query parameter and see if there are any hints after the issue.

cheers,
matti

Hi: Matti:

Here is the logs:

After clicking ‘open’ button to open the window:

7681msRPC invocations to be sent to the server:

7681ms 134 (class com.vaadin.client.connectors.ButtonRendererConnector) :

7682ms com.vaadin.shared.ui.grid.renderers.RendererClickRpc.click([1, 4, LEFT,1203,164,false,false,false,false,1,-1,-1]
)

7686msSending xhr message to server: {“csrfToken”:“89d6d013-4544-43eb-b635-45b085fea43e”,“rpc”:[[“134”,“com.vaadin.shared.ui.grid.renderers.RendererClickRpc”,“click”,[“1”,“4”,{“altKey”:false,“button”:“LEFT”,“clientX”:1203,“clientY”:164,“ctrlKey”:false,“metaKey”:false,“relativeX”:-1,“relativeY”:-1,“shiftKey”:false,“type”:1}]
]],“syncId”:1,“clientId”:1}

7705msServer visit took 18.994ms

7705msJSON parsing took 0.095ms

7706msReceived xhr message: for(;;);[{“syncId”: 2, “clientId”: 2, “changes” : [[“change”,{“pid”:“115”},[“0”,{“id”:“115”}]
],[“change”,{“pid”:“137”},[“29”,{“id”:“137”,“v”:{“action”:“”}},[“actions”,{},[“action”,{“key”:“1”,“kc”:27,“mk”:
}]]]]], “state”:{“137”:{“modal”:true,“centered”:true,“tabIndex”:-1,“width”:“400.0px”,“caption”:“Main Editor”},“138”:{“spacing”:true,“childData”:{“139”:{“alignmentBitmask”:5,“expandRatio”:0},“143”:{“alignmentBitmask”:34,“expandRatio”:0}},“marginsBitmask”:15,“width”:“100.0%”},“139”:{“spacing”:true,“childData”:{“140”:{“alignmentBitmask”:5,“expandRatio”:0},“141”:{“alignmentBitmask”:5,“expandRatio”:0},“142”:{“alignmentBitmask”:5,“expandRatio”:0}},“marginsBitmask”:5,“width”:“100.0%”,“id”:“form-layout”},“140”:{“maxLength”:50,“width”:“250.0px”,“caption”:“First Name”,“captionAsHtml”:true},“141”:{“maxLength”:50,“width”:“250.0px”,“caption”:“Last Name”,“captionAsHtml”:true},“142”:{“maxLength”:50,“width”:“250.0px”,“caption”:“Email”,“captionAsHtml”:true},“143”:{“spacing”:true,“childData”:{“144”:{“alignmentBitmask”:5,“expandRatio”:0},“145”:{“alignmentBitmask”:5,“expandRatio”:0}},“id”:“h-layout”},“144”:{“caption”:“Save”},“145”:{“caption”:“Close”}}, “types”:{“115”:“0”,“137”:“29”,“138”:“9”,“139”:“31”,“140”:“30”,“141”:“30”,“142”:“30”,“143”:“32”,“144”:“13”,“145”:“13”}, “hierarchy”:{“115”:[“116”,“137”]
,“137”:[“138”]
,“138”:[“139”,“143”]
,“139”:[“140”,“141”,“142”]
,“143”:[“144”,“145”]
}, “rpc” : , “meta” : {}, “resources” : {}, “typeMappings” : { “com.vaadin.ui.AbstractTextField” : 33 , “net.practice1.web.vaadin.MainEditor” : 29 , “com.vaadin.ui.HorizontalLayout” : 32 , “com.vaadin.ui.AbstractField” : 34 , “com.vaadin.ui.FormLayout” : 31 , “com.vaadin.ui.TextField” : 30 , “com.vaadin.ui.Window” : 35 , “com.vaadin.ui.Panel” : 36 }, “typeInheritanceMap” : { “14” : 21 , “9” : 14 , “13” : 27 , “17” : 20 , “33” : 34 , “18” : 20 , “29” : 35 , “25” : 18 , “32” : 14 , “34” : 20 , “31” : 14 , “0” : 25 , “27” : 20 , “30” : 33 , “20” : 15 , “21” : 17 , “35” : 36 , “36” : 18 }, “timings”:[1199, 4]
}]

7706msHandling message from server

7706ms* Handling resources from server

7707ms* Handling type inheritance map from server

7707msHandling type mappings from server

7707msHandling resource dependencies

7708ms* Handling meta information

7708ms* Creating connectors (if needed)

7729ms* Updating connector states

7735ms* Handling locales

7735ms* Updating connector hierarchy

7736ms* Sending hierarchy change events

7759ms* Running @DelegateToWidget

7762ms* Sending state change events

7784ms* Passing UIDL to Vaadin 6 style connectors

7786ms* Performing server to client RPC calls

7787ms* Unregistered 0 connectors

7787mshandleUIDLMessage: 79 ms

7787msStarting layout phase

7795msMeasured 5 non connector elements

7801msPass 1 measured 7 elements, fired 0 listeners and did 1 layouts.

7805msPass 2 measured 3 elements, fired 0 listeners and did 0 layouts.

7809msDid overflow fix for 2 elements

7815msPass 3 measured 3 elements, fired 0 listeners and did 0 layouts.

7816msNo more changes in pass 4

7825msTotal layout phase time: 37ms

7826ms* Dumping state changes to the console

7826msUIDL: undefined

7839msProcessing time was 133ms

7840msReferenced paintables: 31

After clicking ‘close’ button to close modal window, the shade to block main page is gone, and the window is still shown:

7840msRPC invocations to be sent to the server:

7841ms 168 (class com.vaadin.client.ui.window.WindowConnector) :

7841ms v.v(positionx : 640)

7842ms v.v(positiony : 327)

7842ms 176 (class com.vaadin.client.ui.button.ButtonConnector) :

7842ms com.vaadin.shared.ui.button.ButtonServerRpc.click([LEFT,1014,552,false,false,false,false,1,41,22]
)

7843msSending xhr message to server: {“csrfToken”:“89d6d013-4544-43eb-b635-45b085fea43e”,“rpc”:[[“168”,“v”,“v”,[“positionx”,[“i”,640]
]],[“168”,“v”,“v”,[“positiony”,[“i”,327]
]],[“176”,“com.vaadin.shared.ui.button.ButtonServerRpc”,“click”,[{“altKey”:false,“button”:“LEFT”,“clientX”:1014,“clientY”:552,“ctrlKey”:false,“metaKey”:false,“relativeX”:41,“relativeY”:22,“shiftKey”:false,“type”:1}]
]],“syncId”:2,“clientId”:2}

7870msServer visit took 26.452ms

7871msJSON parsing took 0.096ms

7871msReceived xhr message: for(;;);[{“syncId”: 3, “clientId”: 3, “changes” : [[“change”,{“pid”:“146”},[“0”,{“id”:“146”}]
]], “state”:{}, “types”:{“146”:“0”}, “hierarchy”:{“146”:[“147”]
}, “rpc” : , “meta” : {}, “resources” : {}, “timings”:[1274, 12]
}]

7872msHandling message from server

7872ms* Handling resources from server

7873ms* Handling type inheritance map from server

7873msHandling type mappings from server

7874msHandling resource dependencies

7874ms* Handling meta information

7875ms* Creating connectors (if needed)

7875ms* Updating connector states

7876ms* Handling locales

7876ms* Updating connector hierarchy

7878ms* Sending hierarchy change events

7889ms* Running @DelegateToWidget

7890ms* Sending state change events

7890ms* Passing UIDL to Vaadin 6 style connectors

7891ms* Performing server to client RPC calls

7893ms* Unregistered 9 connectors

7893mshandleUIDLMessage: 18 ms

7893msStarting layout phase

7894msMeasured 0 non connector elements

7904msPass 1 measured 3 elements, fired 0 listeners and did 0 layouts.

7904msNo more changes in pass 2

7905msTotal layout phase time: 11ms

7905ms* Dumping state changes to the console

7905msUIDL: undefined

7907msProcessing time was 35ms

7908msReferenced paintables: 22

Since the window is still shown, clicking ‘close’ again:

67709msRPC invocations to be sent to the server:

67710ms 168: Warning: no corresponding connector for id 168

67710ms com.vaadin.shared.ui.window.WindowServerRpc.windowMoved([640, 327]
)

67711msIgnoring RPC for removed connector: 168: 168:com.vaadin.shared.ui.window.WindowServerRpc.windowMoved([640, 327]
)

67711msAll RPCs filtered out, not sending anything to the server


Thanks,

Alex