vaadin / vaadin-combo-box-flow

Vaadin Flow Java API for vaadin/vaadin-combo-box Web Component
https://vaadin.com/components/vaadin-combo-box
Other
5 stars 9 forks source link

combo.getValue is null after combo.setValue(object) #88

Closed jcgueriaud closed 6 years ago

jcgueriaud commented 6 years ago

Hello,

Since Vaadin RC2, I've got this problem. I create a combobox, setItems then setValue. When I display value on button click, the value is null.

Here some code to reproduce:

private ComboBox<String> comboBox = new ComboBox("combo");
private Button checkButton = new Button("Check value");

private final String[] dataLabel = {"Label 1","Label 2","Label 3","Label 4"};

public ComboView() {
    comboBox.setItems(dataLabel);
    comboBox.setValue(dataLabel[1]);
    checkButton.addClickListener(event -> Notification.show("Value "+ comboBox.getValue()));
    add(comboBox,checkButton);

    setClassName("main-layout");
}

Here the complete source code: https://github.com/jcgueriaud/test/blob/master/src/main/java/com/gmail/jeanchristophe/ComboView.java

And a running sample:

https://date-tester-vaadin10.herokuapp.com/combo

denis-anisimov commented 6 years ago

Looks like a duplicate of #85. Please confirm.

jcgueriaud commented 6 years ago

Yes, sorry for this. I didn't check closed issues.