That's it!!! Awesome.  Thanks Tracy.

       private var foo:XML = <types>
                   <typex event_type_id="1" label="General" value="foo"/>
                   <typex event_type_id="2" label="Tanning" value="foo"/>
                   <typex event_type_id="3" label="Tennis" value="foo"/>
               </types>

             <mx:ComboBox id="types" width="200" labelField="@label"
dataProvider="{foo.typex}" />

On 12/27/06, Tracy Spratt <[EMAIL PROTECTED]> wrote:

   Try @label, since the values are in attributes.  I think using a
sub-node makes that sub-node a top-level "property" so is accessible using
label.



Tracy


 ------------------------------

*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *Collin Peters
*Sent:* Wednesday, December 27, 2006 12:41 PM
*To:* flexcoders@yahoogroups.com
*Subject:* Re: [flexcoders] Re: Populating a combobox with XML



The point is the when I use a <label> sub-node it DOES work.  From what I
read on the internet I shouldn't have to have a sub-node, hence the point of
my email.  Oh, and I also do have 'labelField="label"' even though that is
the Flex default and not required unless you want to change the name of the
label field.

Collin

On 12/26/06, *Tim Hoff* <[EMAIL PROTECTED]> wrote:

Hi Collin,

Your problem may be that you have an attribute and a node both
named "label". Not sure if this will help, but I don't see the
labelField property set for your comboBox.

<mx:ComboBox id="types" width="200"
dataProvider="{config_xml.types.type}"
labelField="label"/>

If that doesn't work, maybe try using a different name for the extra
node.

-TH

--- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Collin
Peters" <[EMAIL PROTECTED]>


wrote:
>
> I have a problem populating a combobox from XML using data binding.
>
> The XML is as follows:
> <types>
> <type event_type_id="1" label="General" />
> <type event_type_id="2" label="Tanning" />
> <type event_type_id="3" label="Tennis" >
> <label>bar</label>
> </type>
> </types>
>
> The third <type> is different cause it is a point in my problem.
My
> combobox is:
> <mx:ComboBox id="types" width="200"
dataProvider="{config_xml.types.type}" />
>
> Every sample I have found tell me that this should work with the
> attributes from XML. However, the entries in the combobox are
showing
> up blank, though there are three entries. If I put in a <label>
child
> then it does show up. I'm wondering what piece I am missing in
order
> to properly use the attributes from the XML to populate the
combobox
>
>
> --
> Collin Peters
> Lead Software Developer
>





--
Collin Peters
Lead Software Developer




--
Collin Peters
Lead Software Developer

Reply via email to