tags:

views:

17

answers:

0

1 spark List

1 Combo Box

One service populates the list. getAllCDRTiterations()

One service populates the Combo Box. getAllSystem()

One service passes a variable containing a systemID from the selectedItem in Combo Box. getCDRTbySysId()

I'm trying to set the list selectedIndices to the result of getCDRTbySysId(comboBox.selectedItem.sysID)

Here's a sample app I'm using to try and figure it out, anyone mind pointing out the pieces I'm missing?

/frustration level is OVER 9000!

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:systemservice="services.systemservice.*">

<fx:Script>

<![CDATA[

import mx.controls.Alert;

import mx.events.FlexEvent;

import spark.events.IndexChangeEvent;



protected function list_creationCompleteHandler(event:FlexEvent):void

{

  getCDRTiterationsResult.token = systemService.getCDRTiterations();

}



protected function comboBox_creationComplete(event:FlexEvent):void

{

getAllSystemResult.token = systemService.getAllSystem();

}



protected function comboBox_changeHandler(event:IndexChangeEvent):void

{

getCDRTbySysIdResult.token = systemService.getCDRTbySysId(comboBox.selectedItem.sysID);

}



]]>


</fx:Script>



<fx:Declarations>

<s:CallResponder id = "getCDRTiterationsResult"/>

<systemservice.SystemService id="systemService" fault ="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor = "true"/>

<s:CallResponder id = "getAllSystemResult"/>

<s:CallResponder id = "getCDRTbySysIdResult"/>

<s:CallResponder id = "getCDRTiterationsResult"/>

</fx:Declarations>



<s:List id="list" creationComplete="list_creationCompleteHandler(event)" labelField="Iteration">

  <s:AsyncListView list="{getCDRTiterationResult.lastResult}"/>

</s:List>

<s:ComboBox id="comboBox" creationComplete="comboBox_creationCompleteHandler(event)" labelField="sysName" change="comboBox_changeHandler(event)">

<s:AsyncListView list="{getAllSystemResult.lastResult}"/>

</s:ComboBox>

</s:Application>

Thank the gods it's Friday.