Update value of a label

Hey!
This seems like it should be easy but i cant seem to be able to change a label value.
I have the following:

Label errorMessage = new Label();
// ... some code

errorMessage.setValue("Invalid Name");

And im having this error:

The method setValue(String) is undefined for the type LabelJava(67108964)

Hmm which Vaadin Version do you use?
the newer versions use setText(“Invalid Name”)

I would question your usage of Label. It’s NOT intended to be used a general “label” to show information. It’s ONLY usage is to supply a name to a field.

That’s probably the problem.
I want a general label ou a text displayer.

Which is the indicated component for that?

Div, Span, Paragraph :wink: anything except Label I would say :sweat_smile:

Alright I’ll try it! Big thanks!

just a tiny little “but”… :wink:
within the documentation a label is used that way here:
https://vaadin.com/docs/latest/binding-data/components-binder-validation/#customizing-validation-error-messages

@useful-whale can you bann this from the docs? :face_with_monocle: