listBox
listBox
allows users to select a single value from a scrollable list of items.
-
XML element:
listBox
-
Java class:
JmixListBox
Basics
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="com.company.onboarding.entity.OnboardingStatus"/>
In case of entities, first define a collection container and then pass its name to the itemsContainer attribute:
<data>
<collection class="com.company.onboarding.entity.City" id="citiesDc"> (1)
<fetchPlan extends="_base"/>
<loader id="citiesDl">
<query>
<![CDATA[select e from City e]]>
</query>
</loader>
</collection>
</data>
<layout>
<listBox itemsContainer="citiesDc"/> (2)
</layout>
1 | CollectionContainer for the City entity. |
2 | citiesDc is set as an items container for the component. |
Handlers
To generate a handler stub in Jmix Studio, use the Handlers tab of the Jmix UI inspector panel or the Generate Handler action available in the top panel of the view class and through the Code → Generate menu (Alt+Insert / Cmd+N). |
See Also
See the Vaadin Docs for more information.
Was this page helpful?
Thank you for your feedback