Thanks I'll try this
--- In [email protected], Scott Melby <[EMAIL PROTECTED]> wrote:
>
> If you are just trying to get the data from the selected item when the 
> change event fires, you should be able to do the following.
> 
> private function handleChangeEvent(event:ListEvent):void
> {
>     var cBox:ComboBox = ComboBox(event.currentTarget);
>    
>     //assumes the items in your data provider are XML... seems like a 
> safe assumption
>     var myXML:XML = XML(cBox.selectedItem);
>    
>     //access your xml attrs etc. using e4x as normal
>     ...  
> }
> 
> <mx: itemRenderer>
> <mx: Component>
> <mx:ComboBox dataProvider="{outerDocument.myXml.info}"
> change="parentDocument.handleChangeEvent(event)" id="cbItemRenderer"/>
> </mx: Component>
> </mx: itemRenderer>
> 
> 
> hth
> Scott
> 
> Scott Melby
> Founder, Fast Lane Software LLC
> http://www.fastlanesw.com
> http://blog.fastlanesw.com
> 
> 
> 
> jeffreyr6915 wrote:
> > I know that if you want to communicate with the main application from
> > within the itemRenderer component, you have to use "outerDocument"
> > first...Example:
> >
> > <mx: DataGridColumn dataField="field" headerText="col1"
> > editorDataField="text" editable="true">
> >
> > <mx: itemRenderer>
> > <mx: Component>
> > <mx:ComboBox dataProvider="{outerDocument.myXml.info}"
> > change="myMethod(dg.instanceIndex)" id="cbItemRenderer"/>
> > </mx: Component>
> > </mx: itemRenderer>
> >
> > </mx: DataGridColumn>
> >
> >
> > My question is:
> > ---How do you communicate with an itemRenderer from within the main
> > application? It seems like the main app does not have scope to the
> > itemRenderer, because when I add an id attribute to the <mx:ComboBox>
> > tag, I cannot refer to it...Example:
> >
> > cbItemRenderer.getSelectedItem().label)
> >
> >
> > Thanks
> >
> >
> >
>


Reply via email to