TwinColumn is a multiple selection component that shows two lists side by side, with the left column containing unselected items and the right column the selected items. Users can select the values by transferring them from the left to the right and backward using a double click or dedicated buttons.

twin column

Component’s XML-name: twinColumn.


Below is an example of TwinColumn component usage to select entity instances. To specify possible values, use the optionsContainer attribute with the id of the desired collection of entities as a value.

@Table(name = "UIEX1_EMPLOYEE")
@Entity(name = "uiex1_Employee")
public class Employee {
    @Column(name = "NAME")
    private String name;

    @Column(name = "ID", nullable = false)
    private UUID id;
    <collection id="employeesDc"
        <fetchPlan extends="_local"/>
        <loader id="employeesDl">
                <![CDATA[select e from uiex1_Employee e]]>
    <twinColumn id="twinColumn"

In the example above, the component displays the Employee entities' field, which is marked with the @InstanceName annotation. The component value is a list of the selected entities.

For example, let’s define a button displaying a list of the selected entities' names:

<button id="button" caption="Show value"/>
private TwinColumn<Employee> twinColumn;
private Notifications notifications;
private MetadataTools metadataTools;

protected void onButtonClick(Button.ClickEvent event) {
    StringBuilder sb = new StringBuilder();
    Collection<Employee> employees = twinColumn.getValue();
    if (employees != null) {
                                .map(employee -> metadataTools.getInstanceName(employee))



As a list of the possible values, you can use one of the implementations of the Options interface. Learn more about setting options programmatically on the CheckBoxGroup page.


  1. addAllBtnEnabled attribute shows buttons that move all elements from one column to another. There are the following possible values:

    • true

    • false - the default value.

  2. leftColumnCaption and rightColumnCaption attributes allow you to set captions for the columns.

  3. rows attribute allows you to set the number of rows in each list. The value of height has priority over the value of rows.

Events and Handlers

To generate a handler stub in Jmix Studio, select the component in the screen descriptor XML or in the Jmix UI hierarchy panel and use the Handlers tab of the Jmix UI inspector panel.

Alternatively, you can use the Generate Handler button in the top panel of the screen controller.






See Validator.

TwinColumn XML Element