Class ListBox<T>

Type Parameters:
T - the type of the items contained by this component
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasAriaLabel, HasComponents, HasElement, HasEnabled, HasSize, HasStyle, HasValue<AbstractField.ComponentValueChangeEvent<ListBox<T>,T>,T>, HasValueAndElement<AbstractField.ComponentValueChangeEvent<ListBox<T>,T>,T>, HasTooltip, HasItemComponents<T>, HasDataView<T,Void,ListBoxDataView<T>>, HasListDataView<T,ListBoxListDataView<T>>, SingleSelect<ListBox<T>,T>, Serializable

public class ListBox<T> extends ListBoxBase<ListBox<T>,T,T> implements SingleSelect<ListBox<T>,T>
List Box allows the user to select one or more values from a scrollable list of items. Although its functionally similar to Checkbox Group and Radio Button Group, List Box is designed to be used as a lightweight scrollable selection list rather than a form input field.

List Box also supports using dividers to group related items. Use them sparingly to avoid creating unnecessary visual clutter. List Box supports both single and multiple selection. The former allows the user to select only one item while the latter enables multiple items to be selected.

Items can be rendered with rich content instead of plain text. This can be useful to provide additional information in a more legible fashion than appending it to the item text.

Best Practices:
List Box is not designed to be used as an input field in forms, and lacks features like label, helper, and validation errors. List Box is best suited to be used as a lightweight, scrollable, single-column list for single or multi-selection of items.

Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • ListBox

      public ListBox()
      Creates a new list box component.
  • Method Details