2
votes

Am having an issue with combobox duplications i have 10 autocomplete comboboxes with all having same dataprovider... suppose like this array collection

public var costCenter:ArrayCollection = new
    ArrayCollection(["1101","1111","1121","1131","1141","1151", 
        "1161","1171","1181","1191"]);

if 1st combobox is selected with 1131 then that shouldnt be there in next comboboxes dataprovider. that is already selected items should be removed from collection for dataprovider and user can select 1st any of the 10 comboboxes

am making a copy of collection and using that collection as dataprovider for all comboboxes.. how to remove the already selected items from collection? any ideas? Thanks.

2

2 Answers

3
votes

You can use filterFunction on you ArrayCollection instances and call refresh() on them after selecting values. But all the collections should be different instances from the single Array as a source.

0
votes

The best way to do it is to remove the items from selectedIndices if you are doing version 3.x then you can just do something like comboBox.selectedIndex = -1, but in 4.x you have to do something like comboBox.selectedIndices = new Vector.<int>().