How to resize window based on number of records search on search screen


I am totally new to the vaadin and working one requirement as below.

  • Open the search window
  • search the records and display in the window.

The proble i am facing is, I have set the window height as null so that search window is opend with required size.
Then after searching records are displayed but there is no scrollbar and no resizing of window.I tried with Resize listener but that is not what I am looking for.

I want the the search window should set its height dynamically based on number of records fetched.

Does anybody has any suggestion on this?