remove caption from horizontalLayout


I’m new to this forum and relatively new to vaadin. I tried to find an answer to my question in the existing posts, but maybe I don’t have enough experience to find the right keywords. Is there somebody who can help me?

I have a horizontal layout (primary style: v-horizontallayout) in a form layout in a css layout. In the horizontal layout I sometimes want to show a caption above the data field, and sometimes not. The problem is that there is always a caption shown, weather I set it in the Designer or not. If I don’t set it in the Designer, the technical field name is shown. How can I remove a caption if I don’t want any?

Thank you very much for your help!


do you have a code sample or a screenshot of what you’re talking about?


Marion, if I recall correctly, FormLayout always diplays a caption for its child components.
I did not try it myself, but did you try to call setCaption(null) or setCaption(“”) on the HorizontalLayout programmatically instead of using the designer? Perhaps this solves your problem.

In case that doesn’t work, you might consider replacing the FormLayout with something else like a GridLayout.


Thank you Olli and Kurt for your help.
setCaption(null) did not work, but setCaption(“”) did.