When I choose the first row in a combobox it appears as a choosen value like any other item. I mean that empty row before the first item that I have added.
Question:
Is there any possibility to utilize that first item (empty row) of a combobox in a valueChange listener?
private final ComboBox cities = new ComboBox("City");
...
PersonContainer ds = app.getDataSource();
for (Iterator<Person> it = ds.getItemIds().iterator(); it.hasNext();) {
String city = (it.next()).getCity();
cities.addItem(city);
}
After your suggestion of “ComboBox.setNullSelectionAllowed(boolean)” I found that the first row in my bomboboxes is null.
Thanks