Built-in function
After some research, I found that this is an integrated function in all input controls (TextField, TextArea, DateField, ComboBox).
Vaadin Stream (Vaadin 10)
A function is a property called Placeholder.
You can optionally pass placeholder text to the TextField constructor along with an optional initial value.
new TextField( "label goes here" , "hint goes here" )
Or call the setter and getter: TextField::setPlaceholder and TextField.getPlaceholder .
myTextField.setPlaceholder( "Hint goes here" ) ;
Vaadin 8
A function is a property called Placeholder.
Call the getter / setter methods: TextField::getPlaceholder and TextField.setPlaceholder .
myTextField.setPlaceholder( "Hint goes here" ) ;
Vaadin 7
A function is a property called InputPrompt.
Call the getter / setter methods: TextField::setInputPrompt and TextField::getInputPrompt .
myTextField.setInputPrompt("Hint goes here");
source share