In Flex How to remove duplicates value in ArrayCollection ?


notebookAC.filterFunction = removeDuplicateNoteBookById
notebookAC.refresh();			

var tmpObjPage:Object = new Object();
private function removeDuplicatePageById(item:Object):Boolean
{
     if (!tmpObjPage.hasOwnProperty(item.page_id)) {
	tmpObjPage[item.page_id] = item;
	return true;
	}
	return false;
 }

private function removeDuplicatesValue(element:*,index:int,array:Array):Boolean
{
     return array.indexOf(element)== index;	//Tricks here
}

Leave a comment