tags:

views:

58

answers:

1
public function groupListRH(event:ResultEvent):void {
    groupsList=event.result as ArrayCollection;
}

public function show(event):void {
    selectedItem=(event.target as ComboBox).selectedIndex; 
    Alert.show(selectedItem.toString().groupId);
}

<mx:ComboBox dataProvider="{groupsList}" labelField="groupName" id="grpLst"width="150" prompt="Select One Group" change="show(event);" focusIn="init();" />

I'm not getting like this ...how can I get groupId (exact id which I'm getting into arraycollection thru remoteobject) of selected GroupName?

+2  A: 

In your show() method, you convert the selectedItem to a string before you grab your groupId. You need to switch it around so that you retrieve your groupId from the selectedItem first.

public function show(event):void {
    Alert.show(selectedItem.groupId.toString());
}

<mx:ComboBox id="grpLst"
    width="150"
    dataProvider="{groupsList}"
    labelField="groupName"
    prompt="Select One Group"
    change="show(event);"
/>
Ben Johnson