Double "ComboBox" in a grid

Hello,

I made a grid with Vaadin 14. Then I have created a SelectionMode for the grid but it isnt working the way I want it to. It is generating two ComboBoxes. Does anyone have an idea why. I have another class with a grid, this grid is working correctly.

public class AquariumReview {
	public AquariumReview() {}
	public static ArrayList<Aquarium> aquaList = new ArrayList<>();
	public static Grid<Aquarium> gridAqua = new Grid<>(Aquarium.class);
	public static Set<Aquarium> selectAqua, aquaSelected;
	public static Button löschenAqua = new Button("Löschen");
	public static Button neuesAqua = new Button("Neues Aquarium");
	public static HorizontalLayout buttonAqua = new HorizontalLayout(neuesAqua, löschenAqua);
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static Grid AquarienReview() {
		gridAqua.setColumns("nummer", "ort", "wasserart", "datum");
		gridAqua.addThemeVariants(GridVariant.LUMO_ROW_STRIPES);
		gridAqua.setItems(aquaList);
		gridAqua.setSelectionMode(SelectionMode.MULTI);

		
		gridAqua.addSelectionListener(k -> {
			selectAqua = k.getAllSelectedItems();
		});
		
		löschenAqua.addClickListener(l -> {
			aquaSelected = selectAqua;
			Set <Aquarium> allAqua = new HashSet<Aquarium>(aquaList);
			allAqua.removeAll(aquaSelected);
			Set <Aquarium> löschenListeAqua = new HashSet<Aquarium>(allAqua);
			ArrayList testListeAqua = new ArrayList<Aquarium>(löschenListeAqua);
			aquaList = testListeAqua;
			gridAqua.setItems(aquaList);
		});
		return gridAqua;
	}
}

17845024.png

First of all: I have no answer to your actual question. I don’t know why there are 2 Checkboxes. (not ComboBoxes :P)

I have another input instead, and with a little luck this will also fix your actual problem.

Can you try
public static Grid<Aquarium> gridAqua = new Grid<>(Aquarium.class, false);
or
public static Grid<Aquarium> gridAqua = new Grid<>();

So that it does not create all columns automatically, since you want to define them yourself by calling setColumns(...). This is why the columns in the screenshot are not in the same order as you defined them (they were defined already).

Hello,
thank you for your answer.
Unfortunately your code pieces dont help to “delete” the second CheckBox.