VCustomComponent Height problem

I’m facing the problem with displaying the calendar add-on. The problem is that the page does not show anything, however the in the Debug window, the Analyze Layouts report complains about Height of the VerticalLayout


Layouts analyzed on server, total top level problems: 1 


	Root problems
	
VCustomComponent id: PID6
Height problem: Component with relative height inside a VerticalLayout with no height defined.
Emphasize component in UI
Expand this node to show problems that may be dependent on this problem.

The Jetty console output also shows something suspicious:


- Window/1e84195 "Lab usage application" (height: MAIN WINDOW)
  - VerticalLayout/83df14 (height: UNDEFINED)
    - MainComponent/1b27882 (height: RELATIVE, 100.0 %)
Layout problem detected: Component with relative height inside a VerticalLayout with no height defined.
Relative sizes were replaced by undefined sizes, components may not render as expected.

Sub errors >>
Vaadin DEBUG
- Window/1e84195 "Lab usage application" (height: MAIN WINDOW)
  - VerticalLayout/83df14 (height: UNDEFINED)
    - MainComponent/1b27882 (height: RELATIVE, 100.0 %)
      - AbsoluteLayout/1a30706 (height: RELATIVE, 100.0 %)
Layout problem detected: A component with relative height needs a parent with defined height.
Relative sizes were replaced by undefined sizes, components may not render as expected.

I’ve encapsulated the calendar add-on into CustomComponent using the Visual User Interface Design with Eclipse. I don’t know from where the problematic VerticalLayout comes from since I haven not used it in my code.

If someone is willing to give me a hand I’m attaching the following:

  • calendar.zip - maven project that can be imported into the eclipse to see the code details and reproduce the problem [mvn vaadin:update-widgetset gwt:compile package jetty:run]

  • maven compilation output with jetty console outputs

Thanks in advance for any help,
Roman
11672.zip (7.44 KB)
11673.txt (18.3 KB)

Your custom component (MainComponent.java) you have made with the VVD is 100%x100% wide, this means that the layout you put it in must define a size for it, or you must specifically specify a size for it in the VVD.

You are now adding the component to the Windows undefined size VerticalLayout in CalApplication.java, which will trigger that error. To fix it you can call window.getContent().setSizeFull() to give the VerticalLayout full size. This should fix the problem.

Yes, that solves the problem :slight_smile:

Thank you!