'What is the replacement for ListSelect in Vaadin 22?
I'm trying to update an application from Vaadin 7/8 to Vaadin 22.
ListSelect is gone, so I need a new widget field that satisfies these requirements:
- Allows choosing multiple items
- Suitable for use in
FormLayoutwith value bound usingBinder - Scrolls automatically when there are more than a handful of choices
None of the widgets in Vaadin 22 seem to qualify:
SelectandComboBoxonly choose one itemListBoxsays ...designed to be used as a lightweight scrollable selection list rather than a form input fieldGriddoes not implementHasValueso can't be used withBinderCheckBoxGroupdoesn't look like it will scroll (requirement #3) (I haven't actually tried yet though)
What am I missing here?? What is the new equivalent of the old ListSelect?
Solution 1:[1]
If your Grid is set to multiselect mode, you can use grid.asMultiSelect() to return a MultiSelect object that does implement HasValue and can be used with Binder. Similarly, in single-select mode, grid.asSingleSelect() returns a bindable SingleSelect object.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ollitietavainen |
