Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
ComboBox doesn't update
Hi, I have a Combobox which contains 3 items (id : 1,2,3). I can select them via the mouse. By default, my combobox is on blank field (no item selected). When I want to change its value via a button (setValue(1) ,for example), my ComboBox doesn't update !
I don't understand this behavior ! Someone can help me ? :)
public void construireListeExecutions(List<Execution> executions) {
//On remet le composant à zéro
listeDeroulanteExecutions.removeAllItems();
listeDeroulanteExecutions.setNullSelectionAllowed(false);
//Pour chaque execution, creation d'un item dans la liste
for (Execution execution : executions) {
listeDeroulanteExecutions.addItem(execution.getId());
listeDeroulanteExecutions.setItemCaption(execution.getId(), execution.getNom());
}
System.out.println("before "+listeDeroulanteExecutions.getValue());
listeDeroulanteExecutions.setValue(2);
System.out.println("after "+listeDeroulanteExecutions.getValue());
}
Anyway, when I make a SetValue(), in reality, the value doesn't change..
Resultat :
before 1
after 1
Ok, what does execution.getId() return (Which type)?
Because basically, this should work.
Thanks for quick answer !
But I resolved my problem. My Ids on my combobox are Long, not Integer.. So I replace 2 to 2L and it works correctly !
thanks Tom ;) have a good day