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.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Supporting HTML on captions

Daniel Icardo
10 years ago Feb 28, 2012 6:07pm


I don't know if the Form objects actually support HTML code in their captions (the captions of the fields actually) or not, but my experience with them shows that this is not the case.

There's something along the way that escapes strings like: "Hello<br/> bla, bla, bla", and I need captions to interpret that as HTML. I know one way would be to simple replace the caption manually with a Label, but I don't want to lose additional caption properties, like left positioning and required marking.

I've taken a look at the current implementation of PaintTarget, namely JsonPaintTarget, but the answer doesn't seem to be there, since this only escapes characters that could be misinterpreted as JSON.

So, in short, I would like to know if there's currently a way to make a particular component such as an instance of Form support HTML content, without applying a custom caption structure, such as the aforementioned Label strategy or the CssLayout with a template strategy.


Marko Grönroos
10 years ago Mar 01, 2012 1:06pm
Piotr Ozga-Michalski
7 years ago Jan 05, 2015 1:28pm
Marko Grönroos
7 years ago Jan 08, 2015 10:27am