InputPromt as DefaultValue for TextField

Hi all,

I would like to suggest the User a DefaultValue for the InputFields.
The Vaadin Textfield has the method setInputPromt that can give Hints or Names inside the TestField.
But if you click in to the field the Promt vanishes…
I would like to allow the User to just hit Enter to Confirm the Value or enter a different Value.

Is there a method I am missing?

Thanks for any hints

I’m not an expert, but you could just set the default value with setText, and add a listener on the focus event to select all the text when the filed get focus. Pheraps you should be able to use also a UI Extension to implement this client-side.

ps. you could also listen for the Enter key event on the fileld, and if it’s empty use setText to copy the imputPrompt as Value

Thansk for the Tip.
Looks like I have to make an ClientSide-Extension. I hoped there was an existing Add-On or Function in Vaadin for that so I wouldn’t have to do it myself.
As I am not that good in ClientSide development.
Well good example to get started with :slight_smile: