listBox allows users to select a single value from a scrollable list of items.

  • XML element: listBox

  • Java class: JmixListBox


listbox can be populated with items from either an enumeration or collection of entities.

Use the itemsEnum attribute to directly specify the name of the enumeration class:

<listBox itemsEnum=""/>

In case of entities, first define a collection container and then pass its name to the itemsContainer attribute:

    <collection class="" id="citiesDc"> (1)
        <fetchPlan extends="_base"/>
        <loader id="citiesDl">
                <![CDATA[select e from City e]]>
    <listBox itemsContainer="citiesDc"/> (2)
1 CollectionContainer for the City entity.
2 citiesDc is set as an items container for the component.
list box basics


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


See Also

See the Vaadin Docs for more information.