Expanding window fails horizontally

I am builing an expanding Window/layout that shall expand/shrink on supplied data, possibly expanding to fill the browser window.

  • So far i have only managed to get it working vertically with a simple list of labels (see simple_list.png).
    Vertical scrollbar appear when browser window filled vertically
    Horizontal scrollbar alway present and width of window/layout seems directed by length of panel title and window icons at top-right.
  • It fails completeley for a GridLayout (see gridlayout.png).

The final layout is supposed to have a central work area and header, footer, left/right areas.
The work area to expand according to data.
Any help/guidance appreciated.

A simplified test case below (Vaadin 7, subclassing Window).

public TestWindow() {

	super.setSizeUndefined();
	
	VerticalLayout vL = new VerticalLayout();
	vL.setSizeFull();
	super.setContent(vL);
	
	//vL.addComponent(buildHeader());
	
	Panel workArea = new Panel();
	workArea.setSizeFull();
	workArea.setCaption("View");
	vL.addComponent(workArea);
	vL.setExpandRatio(workArea, 1f);
	
	
	//vL.addComponent(buildFooter());

	//-----------------------------
	
	VerticalLayout view = new VerticalLayout();
	view.setSizeUndefined();
	workArea.setContent(view);
	
	for (int i=0; i < 100; i++) {
		String s = "view line "+i;
		for (int j=0; j < 10; j++) {
			s += "____________________"+j;
		}
		Label line = new Label(s);
		line.setSizeUndefined();
		view.addComponent(line);
	}
	
	//=============================
	/*
	VerticalLayout view = new VerticalLayout();
	view.setSizeUndefined();
	workArea.setContent(view);
	GridLayout gl = new GridLayout();
	gl.setSizeUndefined();
	view.addComponent(gl);
	view.setExpandRatio(gl,  1);
	gl.setColumns(2);
	for (int i=0; i < 100; i++) {
		Label line = new Label("view line "+i);
		line.setSizeUndefined();
		gl.addComponent(line);
	}
	*/
	//------------------------------
	
	center();
	
	setModal(true);
	
	super.setDraggable(true);
	
	UI.getCurrent().addWindow(this);
}

17048483.png
17048486.png