<mx:ComboBox labelField="name">
<mx:itemRenderer>
<mx:Component>
<mx:TextInput text={data[labelField]} />
</mx:Component>
</mx:itemRenderer>
</mx:ComboBox
In itemrenderer I want to get the labelField property of the combobox
but how can I get it..
when I used this.parent in itemrenderer its showing some 'ListBast and
not the 'ComboBox'
--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.
--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.
Is there any other way?
On Jan 4, 7:59 pm, Kiran Kumar Vasireddy <kiranv...@gmail.com> wrote:
> Did you try giving an Id to combox and tried accessing it directly or by
> using outerDocument ?
>
> Regards
> Kirab
>
> On Sat, Jan 2, 2010 at 5:04 AM, comgeek <munagaprav...@gmail.com> wrote:
> > my Code is like this
>
> > <mx:ComboBox labelField="name">
> > <mx:itemRenderer>
> > <mx:Component>
> > <mx:TextInput text={data[labelField]} />
> > </mx:Component>
> > </mx:itemRenderer>
> > </mx:ComboBox
>
> > In itemrenderer I want to get the labelField property of the combobox
> > but how can I get it..
>
> > when I used this.parent in itemrenderer its showing some 'ListBast and
> > not the 'ComboBox'
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Flex India Community" group.
> > To post to this group, send email to flex_...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > flex_india+...@googlegroups.com<flex_india%2Bunsu...@googlegroups.com>
You can try this.
/** CustomComboBox.mxml**/
<?xml version="1.0" encoding="utf-8"?>
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:itemRenderer>
<mx:Component>
<mx:TextInput text="{data.outerDocument.labelField}" />
</mx:Component>
</mx:itemRenderer>
</mx:ComboBox>
/** Sample.mxlml **/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" xmlns:local="*">
<mx:Array id="arr">
<mx:Object label="Student A" score="85" />
<mx:Object label="Student B" score="48" />
<mx:Object label="Student C" score="71" />
</mx:Array>
<local:CustomComboBox dataProvider="{arr}" labelField="score" />
<local:CustomComboBox dataProvider="{arr}" labelField="label" />
</mx:Application>
With regards,
RajPrabha
> > > flex_india+...@googlegroups.com<flex_india%2Bunsubscribe@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/flex_india?hl=en.- Hide quoted text -
>
> - Show quoted text -
Create a custom combo box and use outerDocument.labelField to get
combo box's labelField.
Check the following code. If you find any other better solution, plz
post it.
/**CustomComboBox.mxml**/
<?xml version="1.0" encoding="utf-8"?>
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:itemRenderer>
<mx:Component>
<mx:TextInput text="{data[outerDocument.labelField]}" />
</mx:Component>
</mx:itemRenderer>
</mx:ComboBox>
/**Sample.mxml**/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" xmlns:local="*">
<mx:ArrayCollection id="arrColl">
<mx:source>
<mx:Array>
<mx:Object label="Student A" score="85" />
<mx:Object label="Student B" score="48" />
<mx:Object label="Student C" score="71" />
</mx:Array>
</mx:source>
</mx:ArrayCollection>
<local:CustomComboBox dataProvider="{arrColl}" labelField="score" />
<local:CustomComboBox dataProvider="{arrColl}" labelField="label" />
</mx:Application>
With regards,
RajPrabha
On Jan 5, 12:44 am, comgeek <munagaprav...@gmail.com> wrote:
> > > flex_india+...@googlegroups.com<flex_india%2Bunsubscribe@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > > >http://groups.google.com/group/flex_india?hl=en.-Hide quoted text -
Really sorry for the previous post.
In that example, item renderer [TextInput] is not displaying.
Use the following code.
<?xml version="1.0" encoding="utf-8"?>
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:itemRenderer>
<mx:Component>
<mx:HBox>
<mx:TextInput width="100%" height="100%" text="{data
[outerDocument.labelField]}" />
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:ComboBox>
Worry for the inconvenience
Raj
On Jan 7, 8:34 am, raj <mrspra...@gmail.com> wrote:
> > > >http://groups.google.com/group/flex_india?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -