combobox - unable to display a value


I have an issue in displaying a value in a combobox.

I am populating the combobox using the below code - UserProxy proxy = new UserProxy(); BeanItemContainer<UserDTO> users = new BeanItemContainer<UserDTO>(UserDTO.class); users.addAll(proxy.getUsers()); accountManager.setContainerDataSource(users); accountManager.setItemCaptionMode(AbstractSelect.ItemCaptionMode.ID); accountManager.setItemCaptionPropertyId("userName");

I have the issue with the below code - accountManager.setValue(leadDTO.getAccountManager());

leadDTO.getAccountManager() returns a UserDTO object. When the view is shown, the combobox has no selected value. Can I know what is wrong with the code?

I am using vaadin 7.1.7.


Either that user doesn’t exist in the container, or (more likely) your UserDTO doesn’t have proper equals() and hashcode() methods.

The equals and hashcode was missing in the dto. I added them and it works fine. Thanks for the help.