Hi friends ,

I have comboBox  and it is bind to array collection .
the  data in arraycollection is populating from backends , and I have to set
the data on comboBox.

for this I have made a change event on array collection , like :-
private function fillcombo():void{
    populate state();

cmbState.dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE,
setState);
}


and
public function setState(event : CollectionEvent):void {
    for(var loop:int=0; loop < arrState.length; loop++){
                if(arrState[loop].label == "delhi"){
                     cmbstate.selectedIndex = loop;

cmbState.dataProvider.removeEventListener(CollectionEvent.COLLECTION_CHANGE,
setState);
                     break;
                  }
            }
}

but problem of it is ,unnecessary loop is calling , Is there any other way
so that I I can run for loop to set data only when the whole data is set to
the arraycollection.


thanks in advance
kundan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to