Joe:

Here is a complete mxml file using your code (I don't know if it will
display correctly, I'm using gmail's "plain text"--apologies in
advance if it's mangled).  It works fine--the combo box shows the demo
and demo2, and after the change it shows post_change_demo and
post_change_demo2 (for that you need the Bindable--otherwise the combo
box won't see changes to dataSetColl.

Maybe you can give us more detail about how you have it set up?  I
don't think the problem is with the code, but maybe stuff is outside
the package, or you don't actually have the value assigned to
dataSetColl that you think you do?

mike

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
<mx:Script>
        <![CDATA[
                import mx.collections.XMLListCollection;
        var XML1:XML = <ListDatasetsResponse>
<Datasets>
<Dataset id="001">
<DisplayName>demo</DisplayName>
<ReportData>
<Overview />
<Detail url="/detail1"/>
</ReportData>
</Dataset>
<Dataset id="002">
<DisplayName>demo2</DisplayName>
<ReportData>
<Overview />
<Detail url="/detail2"/>
</ReportData>
</Dataset>
</Datasets>
</ListDatasetsResponse>;        
        
[Bindable] var dataSetColl:XMLListCollection = new XMLListCollection(
XML1.Datasets.Dataset );
        

private function boxLabelFuntion(item):String
{
return XML(item).DisplayName.valueOf();
}
import mx.controls.Alert;
private function onChange():void {
        XML1=
        <ListDatasetsResponse>
<Datasets>
<Dataset id="001">
<DisplayName>post_change_demo</DisplayName>
<ReportData>
<Overview />
<Detail url="/detail1"/>
</ReportData>
</Dataset>
<Dataset id="002">
<DisplayName>post_change_demo2</DisplayName>
<ReportData>
<Overview />
<Detail url="/detail2"/>
</ReportData>
</Dataset>
</Datasets>
</ListDatasetsResponse>;
dataSetColl = new XMLListCollection( XML1.Datasets.Dataset );
}
        ]]>

</mx:Script>



<mx:ComboBox id="dataSetBox" dataProvider="{dataSetColl}"
labelFunction="boxLabelFuntion" change="onChange();" x="0"
y="-2" width="201" height="20"></mx:ComboBox>
</mx:Application>


On Nov 29, 2007 5:50 PM, kuroiryu42 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> When I trace the code it seems like the label function is working
> great it returns demo as a string yet i see nothing on the comobox.
> What am I missing here?! sooo frustrated.
>
> Another question, how do i get responses to my questions without
> having to search through the all the groups messages?
>
> XML1 = <ListDatasetsResponse>
> <Datasets>
> <Dataset id="001">
> <DisplayName>demo</DisplayName>
> <ReportData>
> <Overview />
> <Detail url="/detail1"/>
> </ReportData>
> </Dataset>
> <Dataset id="002">
> <DisplayName>demo2</DisplayName>
> <ReportData>
> <Overview />
> <Detail url="/detail2"/>
> </ReportData>
> </Dataset>
> </Datasets>
> </ListDatasetsResponse>
>
> after the http call comes back i initialize the dataprovider for my
> combobox
>
> dataSetColl = new XMLListCollection( XML1.Datasets.Dataset );
>
> private function boxLabelFuntion(item):String
> {
> return XML(item).DisplayName.valueOf();
> }
>
> <mx:ComboBox id="dataSetBox" dataProvider="{dataSetColl}"
> labelFunction="boxLabelFuntion" change="dataSetBoxChange(event)" x="0"
> y="-2" width="201" height="20"></mx:ComboBox>
>
> Thanks,
> Joe
>
> 

Reply via email to