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] <mailto:[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 <mailto: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 

 

Reply via email to