strange to make liferay portlet

I’m using liferay ide to ceate a vaadin portlet.I copy the code from tutorial
SampleAddressBook
,but it display only small row.

However I change the first serval line from this:
HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
setMainWindow(new Window(“Address Book”, splitPanel));
to:
HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
Window mainWindow=new Window(“new windows test”);
mainWindow.addComponent(splitPanel);
setMainWindow(mainWindow);
It works fine.
Why?
12726.jpg
12727.jpg

The first option creates HorizontalSplitPanel as the content of a Window. The second option adds the split panel as a component into the default content of the Window (VerticalLayout).

The first setup is Window (undefined size) → HorizontalSplitPanel (100% x 100%), which would be invalid combination having relative size inside an undefined sized component, but Window fixes that by checking the content and adjusting its size according to the content size.

The second setup is Window (undefined size) → VerticalLayout (100% x undefined) → HorizontalSplitPanel (100% x 100%). Again Window adjusts it size and this time to 100% x undefined. Now that’s actually and invalid combination, because now the relative height split panel is inside undefined height component.

The second option just happens to work correctly. The first option doesn’t work probably because the mainWindow is relatively sized, but the portlet is not sized properly. It has a relative html size perhaps?