Form binding: How to bind a list of Strings

Hi,

I have a class with a Set of Strings e.g. paths or protocols … how can I bind it to a form? Is there a way to dynamically create textfields based on the amount of values?

What’s the best and simplest solution ? Are there any code samples around?

@Data
public class RouteDetails {

    private String id;
    private String name;
    private Set<String> paths;
    private Set<String> protocols;
    private Set<HttpMethod> methods;

}

You can bind Set of Strings to a field that returns set of Strings, i.e. something that implements [MultiSelect]
(https://vaadin.com/api/platform/11.0.1/com/vaadin/flow/data/selection/MultiSelect.html) and is parametrized with String. This can be build in field component (e.g. Grid as MultiSelect) or your own. E.g. you can implement custom field by extending text area where you input list of comma separated strings. Field will have internal logic parsing the String to sub Strings, i.e. returning Set of Strings.