Flex arraycollection getitemindex always return -1?

GetItemIndex is not comparing the value within your arrayCollection. The problem is that the getItemIndex() method matches exact object references, not objects with matching properties.

GetItemIndex is not comparing the value within your arrayCollection. The problem is that the getItemIndex() method matches exact object references, not objects with matching properties. You should use a solution like this instead.

Besides, if you only want to store key-values informations, I strongly suggest you to use a dictionary or, at least, a dynamic object. – LoremIpsum Dec 21 at 10:42.

GetItemIndex only searches the root object. So for example this would work: var dataList:ArrayCollection = new ArrayCollection("alauddn", "ansari"); private function getItemInd(event:MouseEvent):void{ var name:String = "ansari"; var ias:int = dataList. GetItemIndex(name); Alert.

Show(ias.toString() + ": " + name); }.

You can use this. Private function getItemInd(event:MouseEvent):void{ for each( var item:Object in dataList){ if(item. Name == "ansari") { var ias:int = dataList.

GetItemIndex(item); Alert. Show(ias.toString() + ": " + item. Name); break; } } }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions