Sub window

i’m trying to popup a sub window on click of a button (), but I’m not able to… below is the code in my Root

@Override
	protected void init(WrappedRequest request) {
		getApplication().setRootPreserved(true);
		addPopupWindow();
	}


	private void addPopupWindow() {
		HorizontalLayout layout = new HorizontalLayout();
		final Window window = new Window("My Window");
		window.setClosable(true);
		window.setImmediate(true);
		window.center();
		window.setWidth(400, Unit.PIXELS);
		window.setHeight(300, Unit.PIXELS);
		window.addComponent(new Button("Close", new ClickListener() {
			@Override
			public void buttonClick(ClickEvent event) {
				removeWindow(window);
			}
		}));
		layout.addComponent(new Button("Add", new ClickListener() {
			@Override
			public void buttonClick(ClickEvent event) {
				addWindow(window);
			}
		}));
		setContent(layout);
	}

and below are the msgs in the debug window

Drag title=move, shift-drag=resize, doubleclick title=min/max.Use debug=quiet to log only to browser console.
18:40:32:343 Starting Vaadin client side engine. Widgetset: com.vaadin.terminal.gwt.DefaultWidgetSet
18:40:32:346 Widget set is built on version: 7.0.0.nightly-20120508-2b4abbe715a278146d2d53f0d75b4ec1a47506dd
18:40:32:364 Starting application simple-902286926
18:40:32:364 Vaadin application servlet version: 7.0.0.nightly-20120508-2b4abbe715a278146d2d53f0d75b4ec1a47506dd
18:40:32:364 Application version: NONVERSIONED
18:40:32:366 inserting load indicator
18:40:32:367 JSON parsing took 1ms
18:40:32:367 Handling message from server
18:40:32:367  * Handling resources from server
18:40:32:368  * Handling type inheritance map from server
18:40:32:368 Handling type mappings from server
18:40:32:377  * Handling locales
18:40:32:378  * Handling meta information
18:40:32:378  * Creating connectors (if needed)
18:40:32:380  * Updating connector states
18:40:32:382  * Updating connector hierarchy
18:40:32:382  * Sending hierarchy change events
18:40:32:383  * Sending state change events
18:40:32:387  * Passing UIDL to Vaadin 6 style connectors
18:40:32:389 * Unregistered 0 connectors
18:40:32:389 handleUIDLMessage: 11 ms
18:40:32:390 Starting layout phase
18:40:32:393 Measured 1 non connector elements
18:40:32:393 Layout init in 3 ms
18:40:32:399   Measured 3 elements in 6 ms
18:40:32:401 Pass 1 completed in 8 ms
18:40:32:402   Measured 1 elements in 1 ms
18:40:32:402 Pass 2 completed in 1 ms
18:40:32:402 Did overflow fix for 1 elements  in 0 ms
18:40:32:403   Measured 1 elements in 1 ms
18:40:32:403 Pass 3 completed in 1 ms
18:40:32:403 No more changes in pass 4
18:40:32:403 Invoke post layout listeners in 0 ms
18:40:32:403 Total layout phase time: 13ms
18:40:32:403  * Layout processing completed: 14 ms
18:40:32:403  Processing time was 36ms for 2438 characters of JSON
18:40:32:404 Referenced paintables: 3
18:40:40:740 Variable burst to be sent to server:
18:40:40:742 	2 (class com.vaadin.terminal.gwt.client.ui.button.ButtonConnector) :
18:40:40:743 		com.vaadin.terminal.gwt.client.ui.button.ButtonServerRpc.click([1,42,10,false,false,false,false,1,39,10]
)
18:40:40:753 Making UIDL Request with params: 21f187f3-7d2f-44bb-90c0-b0a5c1e49732[["2","com.vaadin.terminal.gwt.client.ui.button.ButtonServerRpc","click",[["com.vaadin.terminal.gwt.client.MouseEventDetails",{"Button":["i","1"]
, "ClientX":["i","42"]
, "ClientY":["i","10"]
, "AltKey":["b",false]
, "CtrlKey":["b",false]
, "MetaKey":["b",false]
, "ShiftKey":["b",false]
, "Type":["i","1"]
, "RelativeX":["i","39"]
, "RelativeY":["i","10"]
}]]]]
18:40:40:772 Server visit took 19ms
18:40:40:773 JSON parsing took 0ms
18:40:40:773 Handling message from server
18:40:40:773  * Handling resources from server
18:40:40:773  * Handling type inheritance map from server
18:40:40:773 Handling type mappings from server
18:40:40:774  * Handling locales
18:40:40:774  * Handling meta information
18:40:40:774  * Creating connectors (if needed)
18:40:40:776  * Updating connector states
18:40:40:777  * Updating connector hierarchy
18:40:40:778  * Sending hierarchy change events
18:40:40:778  * Sending state change events
18:40:40:780  * Passing UIDL to Vaadin 6 style connectors
18:40:40:786 Widget is still attached to the DOM after the connector (ButtonConnector (5)) has been unregistered. Widget was removed.
18:40:40:786 * Unregistered 1 connectors
18:40:40:786 handleUIDLMessage: 12 ms
18:40:40:787 Starting layout phase
18:40:40:789 Measured 1 non connector elements
18:40:40:790 Layout init in 3 ms
18:40:40:791   Measured 3 elements in 1 ms
18:40:40:792 Pass 1 completed in 2 ms
18:40:40:793   Measured 1 elements in 1 ms
18:40:40:793 Pass 2 completed in 1 ms
18:40:40:794   Measured 1 elements in 1 ms
18:40:40:794 Pass 3 completed in 1 ms
18:40:40:795   Measured 1 elements in 1 ms
18:40:40:795 Pass 4 completed in 1 ms
18:40:40:796 Did overflow fix for 1 elements  in 1 ms
18:40:40:796   Measured 1 elements in 1 ms
18:40:40:796 Pass 5 completed in 1 ms
18:40:40:797 No more changes in pass 6
18:40:40:797 Invoke post layout listeners in 0 ms
18:40:40:797 Total layout phase time: 10ms
18:40:40:797  * Layout processing completed: 11 ms
18:40:40:797  Processing time was 24ms for 1957 characters of JSON
18:40:40:797 Referenced paintables: 3
18:40:40:797 Removed variable from removed component: 3