-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ComboBox.setValue(null) does not clear ComboBox after the items has been set #9047
Comments
I have the same issue in my project |
Vaadin 8.0.6 the same |
I confirm I have the same issue with Vaadin 8.0.6 |
Same here, 8.0.6 (I don't know about previous versions, but 7.x was ok). |
I can confirm this bug. Is there any plan to fix this soon? |
Reproducible in 8.1.5 |
Still an issue in 8.3.1 |
I am not sure if I get what the problem is, but I simply could not clear the ComboBox, when the binding BEAN has changed (and a new BEAN has a null in the corresponding field) I fixed it by creating so called ClearableComboBox, with one overriden method:
|
I implemented @mpt74 solution and it works for my use case. Thanks. |
Seems to be fixed with #10796. I will add a regression test for this. |
Hi! |
@andreika63 Fix @tsuoanttila is referring to has not been merged yet. Maybe we can squeeze it to 8.4.0. |
Hi! |
@nixty due to changes in the API, the fix has only been available for 8.5. Can you test |
Hi! |
This issue was already resolved in 8.5 release. I guess there was another similar issue. Closing... |
It would be nice if ComboBox<Object> comboBox = new ComboBox<>();
comboBox.setItems(1, 2, 3);
addComponent(comboBox);
addComponent(new Button("set new items", e -> comboBox.setItems(4, 5, 6))); To reproduce, select 1 at first, and click the button "set new items", then 1 will stay in the ComboBox and cannot be deleted |
That is a different issue. Please create a new one, but I think the issue is bit controversial. IIRC in Vaadin 7 we verified that the value is available, but it is left out because of performance reasons. It might be that we'll do nothing for this, especially as it is very easy for developer to clear the value if needed. |
Vaadin 8.0.5
The below code works flawlessly and clears the ComboBox selection:
Yet, the code below does not work and the previous value stays selected in the combo box:
Please see the sample app attached.
To reproduce the issue, press the "Reset" button, then select a value and press the "Reset" button again. Expected behavior: the value is cleared. Actual behavior: the value is not cleared.
The text was updated successfully, but these errors were encountered: