Search code examples
javavaadin8

Vaadin Combobox returns null


Vaadin ComboBox returns null

the shown combobox

there I get the preselected value:

 this.binder.forField(this.cmbxStockArea).withValidator((t) -> {

        if (cmbxStockArea.getValue().equals("")) {
            return false;
        }
        return cmbxStockArea.getValue() != null;
    }, "es muss ein Lagerplatz gewählt werden").bind(Stock::getStockArea, Stock::setStockArea);

Stock#getStockArea returns just a String.
There I get the the selections.

    this.stockPresenter.getStockAreaSelection().getCmbxSelectedStockArea().setDataProvider(DataProvider.fromStream(StreamSupport.stream(f.spliterator(), false)));

The Validator is working correctly, I printed out getCmbxSelectedStockArea().getValue() and it is null.

There I do the preselection:

this.getCmbxSelectedStockArea().setSelectedItem(getLblSuggestedStockArea().getValue());

After selecting the preselection again by hand everything works fine.

Thx for you help.


Solution

  • It got fixed in Vaadin version 8.1.6.