Selecting an item in select-component using Form

Hi,
I’m trying to create a form using Form. I have some NativeSelect dropdowns where I can’t set any item selected in code. The code below populates selects fine and sets correct item selected (debugged and verified), but in browser no item is selected. Items in selects come all the way to browser, only selection is missing. What am I missing here?


public class SearchLayoutForm extends Form {
		public SearchLayoutForm(BeanItem<IssueSearchCriteria> searchItem) {
			setWriteThrough(false);
			setFormFieldFactory(new SearchFormFieldFactory());
			setItemDataSource(searchItem);
			
			setVisibleItemProperties(Arrays.asList(new String[] {...}));
			
		}
       private class SearchFormFieldFactory extends DefaultFieldFactory  {
			Hashtable ht;
			
			public Field createField(Item item, Object propertyId, Component uiContext) {
				NativeSelect select = null;
				if ("country".equals(propertyId)) {
					[i]
populate select and set selected item
[/i]
					select.setCaption("Country");
               }
               if(select != null) {
					return select;
				}
				Field field = super.createField(item, propertyId, uiContext);
				return field;

I had similar problem.
Item
s were POJO. It started to work for me when I’ve added equals and hashCode methods to POJOs.
Maybe that will help to you.