How to handle input for List<String> in a form?

I have an entity class which has a field of type List.

public class MyEntity {
	private String strField;
	private List<String> listFeild;
}

I want to create a form component which will allow for unfixed number of Strings for listField. For a normal String field I’d simply use a TextField in the form as exampled here: https://vaadin.com/components/vaadin-form-layout/java-examples

I’m not able to think of a way to do this. Any advice would be helpful.

You will have to use a grid for this. [Here]
(https://vaadin.com/forum/thread/17166956/bind-an-arraylist-of-strings) is a good example how to even bind that grid to a Binder

Grid and e.g. ListBox are indeed the easiest ways to show a list of things, especially considering data binding.

I presume you need these list items to be easily editable as well, just like they would be as individual TextFields? In that case Grid is clearly better here, since you can use the editor feature (https://vaadin.com/components/vaadin-grid/java-examples/grid-editor) for editing the items in-line. An unbuffered editor takes you closer to a form-like workflow, and you can make it open on a single click on the row by adding a custom clicklistener to the Grid.

I’ll further presume that you also need a way to add and remove items. For adding, I’d simply have a TextField below the Grid for entering new items. For removing, you could have a remove Button (e.g. a compact icon-only tertiary button) in its own column next to the item text.