Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
How to prevent Vaadin from using an explicit Pixel size
Hi,
I am trying to build an app with vaadin which is as far as possible layoutable via CSS. My problem is that Vaadin oftenly sets an explicit size to my components.
In particular I am creating a wrapped form field which has an enable/disable CheckBox grouped with it. Therefore I am using a custom component with a CSS layout.
{Custom Component
{CssLayout
{Checkbox}
{FormField}
}
}
Unfortunatly I fail to prevent the CustomComponent from being sized explicitly. No matter what I do (setSizeUndefined, setWidth(null) or anything) the CustomComponent always gets a fixed width and height. That collides with my CSS based layout.
What can I do to prevent Vaadin from doing this?
Thanks in advance for any assistance.
Hi!
That is a nasty feature in CustomComponent's client side implementation. I have faced it myself too and I hate it. It is just a bad workaround to fix some trivial IE6 bug.
A quick workaround: ditch that CustomComponent and extend CssLayout instead.
Feel free to add ticket about this nasty "feature". Otherwise fixing it will never end up on our endless task list.
cheers,
matti
Hi,
thanks for your input. Maybe I'll file a bug report. More important than to fix this, is in my opinion do sorowly document which components work without an explicit size and which won't. Especially if one wants to make heavy use of CSS based layouts such as CssLayout or CustomLayout (which I now chose as a solution) it is very important to select only those components which do not explilcitly size their contents.
Greetings
Peer