The <mx:XMLList> tag is a compile-time tag that generates an XMLList object from a text model that consists of valid XML nodes.
Unlike the XMLList class in ActionScript, this tag lets you use MXML
binding expressions in the XML text to extract node contents from variable data.
For example, you can bind a node's name attribute to a text input value,
as in the following line:
<child name="{textInput1.text}"/>
MXML Syntax
You can place an <mx:XMLList> tag in a Flex application file or in an MXML component file.
The <mx:XMLList> tag must have an id attribute value to be referenced by another component.
The <mx:XMLList> tag does not need an id attribute value if the tag is a direct child of an
<mx:dataProvider> tag.
The <mx:XMLList> tag cannot be the root tag of an MXML component.
The <mx:XML> tag has the following syntax:
<mx:XMLList id="list ID"> model declaration </mx:XMLList>
The following example uses the
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#FFFFFF">
<mx:XMLList id="myMenuModel">
<menuitem label="MenuItem A" >
<menuitem label="SubMenuItem 1-A" />
<menuitem label="SubMenuItem 2-A" />
</menuitem>
<menuitem label="MenuItem B" />
<menuitem label="MenuItem C" type="check" />
<menuitem type="separator" />
<menuitem label="MenuItem D" >
<menuitem label="SubMenuItem 1-D" type="radio" groupName="one" />
<menuitem label="SubMenuItem 2-D" type="radio" groupName="one" />
<menuitem label="SubMenuItem 3-D" type="radio" groupName="one" />
</menuitem>
</mx:XMLList>
<mx:MenuBar id="myMenu" labelField="@label" showRoot="true">
<mx:dataProvider>
{myMenuModel}
</mx:dataProvider>
</mx:MenuBar>
</mx:Application>
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/2/langref/mxml/xmlList.html
Comments
Finty said on Jan 22, 2008 at 9:06 AM : Jovin49 said on Jan 22, 2008 at 3:10 PM :