Tab sheet height changing depending on tab - Vaadin 7

I’ve the following, noisy effect when I use a TabSheet in a VerticalLayout : changing tab the height of the tabsheet changes accordingly with the tab content.
I need to have the some height, set to the maximum tab height.
Is it possibile ? How ?
Tks

Hi,
do you mean that you want the TabSheet to always be of the same height regardless of content? If so, you can set the height by using the method TabSheet.setHeight(…).

-Katri

If you want the TabSheet (content) to have a ‘maximum height’, ergo the height changes to accommodate the Tab content but just to a certain extent after which the content is e.g. scrolled, you can probably define that in the theme file by adding a style name to the TabSheet and setting the max-height (and overflow: auto for scrolling) property for the content panel (style name would be .v-tabsheet-content-yourstyle).

-Katri

My proposition was not clear, I suspect.
I want the TabSheet height to be as much as needed to accomodate the content of the largest tab but, when the tab changes it sould maintain such dimension without shrinking.
I can obtain this putting a “fixed” height (say 200px) but I would be better if the framework will calculatre it for me adapting to the screen definition.
Tks

Hi, thanks for the clarification!

Unfortunately I suspect that what you want to do is not possible. The reason is that a TabSheets Tab is present in the page only when it’s the selected Tab. The not-currently-selected Tabs are not present in the HTML page hierarchy at all, ergo their height or any other properties are not calculated or known (to the browser). If you know the height of the largest Tab content (and that the height is always static and always largest), you can obviously just set the size, but with probably changing content height I do think it’s not at least perfectly achievable.

Even if you used the [SizeReporter addon]
(https://vaadin.com/directory/component/sizereporter) to get the height of the largest Tab and listen for sizing events, it wouldn’t know the (initial or new height if content is added to Tab) height before the Tab is opened again… I’m sorry I can’t give a better answer :confused:

-Katri