The documentation for datetimepicker and form binding seems to indicate that the conversion between string and localdate is done automatically without needing a converter but when I try this I get error
There was an exception while trying to navigate to ‘Contacts/Individual’ with the root cause ‘java.lang.IllegalStateException: Property type ‘java.lang.String’ doesn’t match the field type ‘java.time.LocalDate’. Binding should be configured manually using converter.’
If a converter is necessary is there a Vaadin supplied one?
There is no such thing as automatic string to localdate transformation on the server side. Your bean’s property has to be of type LocalDate if you wanna work without converters.
I can check further, the confirmation that it can be done without converter is probably all I need to proceed to find the problem, thanks for now, get back later if necessary.
DateTimePicker’s value type on the server is LocalDateTime. So while you can type text into the input field(s) in the ui, the server-side component knows nothing about Strings
`Binding Data to Forms
How to bind data to forms, which are composites with multiple fields that each bind to sub-structures in data.
How to Bind Form Data
Binding Read-Only Data
In many applications, users provide structured data by completing fields in forms. This data is typically represented in code as an instance of a business object (JavaBean), for example a Person in an HR application.
The Binder class allows you to define how the values in a business object are bound to fields in the UI.
Binder reads the values in the business object and converts them from the format expected by the business object to the format expected by the field. It also handles the reverse process, converting values from UI fields to the format expected by the business object.
Binder can only bind components that implement the HasValue interface, for example TextField and ComboBox.
It’s also possible to validate user input and present the validation status to the user in different ways.
`