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.
Select component doesn't show value (Form with databinding)
Hi,
I'm new with Vaadin and I have a problem with Select component used in a Form with databinding
I have the following entity:
public class Book {
...
private Publisher publisher;
public Publisher getPublisher() {
return publisher;
}
public void setPublisher(Publisher publisher) {
this.publisher = publisher;
}
}
To populate the form I do:
Book book=dao.getBoot(...);
BeanItem<Book> book=new BeanItem<Book>(bookl);
form.setItemDataSource(item,formProperties);
I do the following to populate the select:
List<Publisher> publishers=dao.getPublishers();
BeanItemContainer<Publisher> container=new BeanItemContainer<Publisher>(Publisher.class, publishers);
Select select = new Select("Publisher",container);
After setItemDataSource I get the correct value from the Select field (field.getValue()). BUT the value is NOT shown in the input field of the Select.
When I select a value from the dropdown the value is shown...
Can anybody of you give me a hint what's wrong???
TIA
Martin
O.k. the solution is simple. The entity (in this case Publisher) has to implement equals().