ComboBox Master Slave

I’m having a problem with my comboboxes.

There are 3 comboboxes each depending on eachother.
Users need to select a value in the combobox to have the next combobox filled with possible items.

At the start things go fine. I select a value in the first ComboBox and I open up the second one and it gives me all my options. I select a value there too.

But then, when I decide to choose a new value in the first combobox, the second combobox loads up with new possibilities but I can’t get the previous selected item to be removed.
The item I selected previously is no longer in the new list but still counts as selected. I was wondering if this could be the same problem as:
http://dev.vaadin.com/ticket/4607

The state of that tickets says this is solved but I’m still experiencing this problem.

Here’s the code I run when a value gets selected on the comboboxes:

@Override
	public void valueChange(Property.ValueChangeEvent event) {
		if (event.getProperty() instanceof FamilyActComboBox) {
			sortAct.setSortActComboBox(readTransactions.getSortAct(goodType, event.getProperty().getValue().toString()));
			sortAct.select(sortAct.getItemIds().iterator().next());
			sortAct.setValue(sortAct.getItem(sortAct.getItemIds().iterator().next()));
		} else if (event.getProperty() instanceof SortActComboBox) {
			if (this.getBeanItem().getBean().getFamilyAct() != null
					&& this.getBeanItem().getBean().getSortAct() != null) {
				
				subAct.setSubActComboBox(readTransactions.getSubAct(goodType, this.getBeanItem().getBean()
						.getFamilyAct(), this.getBeanItem().getBean().getSortAct()));
			}
		}
	}

This is an example of one of my ComboBoxes

public class SortActComboBox extends ComboBox implements Serializable {

	private static Logger logger = Logger.getLogger(SortActComboBox.class.getName());

	public SortActComboBox() {
		super();
	}

	public SortActComboBox(Set<String> data) {
		super();

		for (String item : data) {
			addItem(item);
		}
	}

	public void setSortActComboBox(Set<String> data) {
		if (removeAllItems()) {
			if(data != null)
				for (String item : data) {
					addItem(item);
				}
		} else {
			logger.info("Could not remove all items");
		}
	}

}

I’ve added some screenshots too.
11655.jpg
11656.jpg
11657.jpg
11658.jpg

That is a little different to the ticket that you linked to. In the ticket, they change the container. In your code, you keep the container but remove the items.

I don’t know what the expected behaviour of a combobox should be when you remove the item that is selected. Probably choose null but that would fire away a valuechange which might not be wanted etc.

However, I think a workaround to your problem would be to manually deselect the row. Try adding before row 4 in your first code snippet sortAct.select(null);.

If you think it is a bug, create a bug ticket at dev.vaadin.com and attach a minimal test application which demonstrates the problem.