Label / ContentMode.HTML

Hi,

is ContentMode.HTML not allowed in Vaadin Flow? What is the recommended way to use HTML Code?

Thanks Dennis

Hi.

Using HMTL in a label would be label.getElement().setProperty("innerHTML", htmlCode);

For instance to get a button you could have label.getElement().setProperty("innerHTML", "<button>My html button</button>");

  • Mikael

Mikael Grankvist:
Hi.

Using HMTL in a label would be label.getElement().setProperty("innerHTML", htmlCode);

For instance to get a button you could have label.getElement().setProperty("innerHTML", "<button>My html button</button>");

  • Mikael

If we set textarea instead of button how to get its text?

Putting input elements in the innerHTML sounds like a really difficult way of doing things. I would recommend trying another approach.

Olli Tietäväinen:
Putting input elements in the innerHTML sounds like a really difficult way of doing things. I would recommend trying another approach.

hi what was your suggestion for solving this in text area. thanks

roberto viray:

Olli Tietäväinen:
Putting input elements in the innerHTML sounds like a really difficult way of doing things. I would recommend trying another approach.

hi what was your suggestion for solving this in text area. thanks

My suggestion would be not putting other input elements in text areas.