TL DR Vaadin PasswordField is a simple TextField . Input is hidden only on the client side, on the server side it is transmitted in clear text.
Although you can use getConvertedValue() and setConvertedValue(Object value) to get / set the value in your own type. Please note that before using it you need to install setConverter(Converter<T,?> converter) .
Here you have an example of how to use the conversation correctly: Create your own converter to convert String - MyType
FULL EXPLANATION
Vaadin TextField , PasswordField and TextArea are all children of AbstractField<String> .

More details:
java.lang.Object |_ com.vaadin.server.AbstractClientConnector |_ com.vaadin.ui.AbstractComponent |_ com.vaadin.ui.AbstractField<java.lang.String> |_ com.vaadin.ui.AbstractTextField
PasswordField works with String because of its parents, otherwise it had to implement AbstractField<char[]> .
Additionally, the PasswordField section of Vaadin Docs explicitly states:
It should be noted that PasswordField hides the entrance only from visual observation โover the shoulderโ . If the connection to the server is not encrypted using a secure connection such as HTTPS, the input is transmitted in text format and can be intercepted by someone with low-level network access. Also, phishing attacks that intercept browser input may be possible by using JavaScript execution security holes in the browser.
Although AbstractField<T> has getConvertedValue() and setConvertedValue(Object value) which allow you to get / set the value in Object that you prefer. Please note that before using it you need to set setConverter(Converter<T,?> converter) .
Here you have an example of how to use the conversation correctly: Create your own converter to convert String - MyType
Briefly from the example:
Name is a simple POJO with the firstName and lastName fields and their recipient / installer.
Converter class
public class StringToNameConverter implements Converter<String, Name> { public Name convertToModel(String text, Locale locale) { String[] parts = text.split(" "); return new Name(parts[0], parts[1]); } public String convertToPresentation(Name name, Locale locale) throws ConversionException { return name.getFirstName() + " " + name.getLastName(); } public Class<Name> getModelType() { return Name.class; } public Class<String> getPresentationType() { return String.class; } }
Main class
Name name = new Name("Rudolph", "Reindeer"); final TextField textField = new TextField("Name"); textField.setConverter(new StringToNameConverter()); textField.setConvertedValue(name); addComponent(textField); addComponent(new Button("Submit value", new ClickListener() { public void buttonClick(ClickEvent event) { Name name = (Name) textField.getConvertedValue(); } }));
Full source