select allows users to choose a single value from a list of items presented in an overlay.

  • XML element: select

  • Java class: JmixSelect


select is similar to comboBox.

Use select when you don’t need user input and items filtering.

The simplest case of using select is to select a value from an enumeration:

<select itemsEnum=""
        label="Select the day of week"/>
select basics

Data Binding

You can bind a component to an entity and its attributes hold in a data container.

To bind select to an entity attribute:

  1. Specify the name of the data container as the dataContainer attribute value.

  2. Specify the name of the entity attribute as the property attribute value.

  3. Specify the name of the collection data container as the itemsContainer attribute to create a list of items.

    <instance class=""
              id="userDc"> (1)
        <fetchPlan extends="_base"> (2)
            <property name="department" fetchPlan="_base"/>
        <loader id="userDl"/>
    <collection class=""
                id="departmentsDc"> (3)
        <fetchPlan extends="_base"/>
        <loader id="departmentsDl">
                <![CDATA[select e from Department e]]>
    <select dataContainer="userDc"
            itemsContainer="departmentsDc"/> (4)
1 InstanceContainer for the User entity.
2 Inline fetch plan of the entity instance located in the container.
3 CollectionContainer for the Department entity.
4 select gets departmentsDc as an items container so that the list of departments is displayed.



Sets whether the user is allowed to select nothing. When set true a special empty item is shown to the user. Default is false.

The empty selection item can be customized with the emptySelectionCaption attribute.


Sets the empty selection caption when emptySelectionAllowed = true. The caption is shown for the empty selection item in the drop-down.

When the empty selection item is selected, the select shows the value provided by itemLabelGenerator for the null item, or the string set with the placeholder attribute or an empty string if not placeholder is set.


Чтобы сгенерировать заглушку обработчика в Jmix Studio, используйте вкладку Handlers панели инспектора Jmix UI, или команду Generate Handler, доступную на верхней панели контроллера экрана и через меню CodeGenerate (Alt+Insert / Cmd+N).

InvalidChangeEvent is sent when the invalid state changes.

OpenedChangeEvent is sent when the overlay opened state changes.


itemEnabledProvider is applied to each item of select to determine whether the item should be enabled (true) or disabled (false). Disabled items are displayed as grayed out and the user cannot select them. All the items are enabled by default.

@Install(to = "select", subject = "itemEnabledProvider")
private boolean selectItemEnabledProvider(final Department department) {
    if (department != null) {
        return department.getHrManager() != null;
    return true;


See Also

See the Vaadin Docs for more information.