Vaadin ComboBox always displays the previous value if select () is selected

I have a custom ComboBox where, when a user enters values, it loads from a web service. If no values ​​are found, I want the reset combo box to be empty. However, this does not work if the comboBox is initialized with some preselected value. If I call comboBox.select ("") or even comboBox.setValue (null), the previous preselected value is displayed, although I call removeAllItems. This sounds like a comboBox error to me, but maybe someone knows a workaround.

+4
source share
2 answers

comboBox.setValue(null) should work, just make sure you select combobox immediately ( comboBox.setImmediate(true) ) and DO NOT point the null select identifier to something (for example: comboBox.setNullSelectionItemId("null") ).

0
source

Perhaps this is a browser that fills the input from its memory? Try clearing the cache and generating a recorded value.

0
source

Source: https://habr.com/ru/post/1437129/


All Articles