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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
How to set vaadin combobox value with beanitemcontainer?
Hi friends,
I am trying to set combobox value for update a bean item in vaadin. But the combobox selected value comes null when I open it. How can i bind value?
my Company bean;
private int companyID;
private String companyName;
private String email;
private String phone;
private String location;
private Date creationDate;
private Date expireDate;
private boolean inActive;
my User Bean;
private int userId;
private String username;
private String password;
private Company company;
private EUserRole userRole;
private String email;
private String firstName;
private String lastName;
ui class;
BeanItemContainer<Company> itemContainer = new BeanItemContainer<Company>(Company.class);
itemContainer.addAll(companyService.getAllCompanies());
cbxCompanyName = new ComboBox("Company Name", itemContainer);
cbxCompanyName.setWidth("50%");
cbxCompanyName.setNullSelectionAllowed(false);
cbxCompanyName.setItemCaptionMode(ItemCaptionMode.PROPERTY);
cbxCompanyName.setImmediate(true);
cbxCompanyName.setItemCaptionPropertyId("companyName");
cbxCompanyName.setNewItemsAllowed(false);
details.addComponent(cbxCompanyName);
cbxCompanyName.setValue(admin.getCompany());
here is my secreenshot;
Last updated on
You cannot reply to this thread.