Bind Data Model to Label : Label Data « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » Label DataScreenshots 
Bind Data Model to Label
Bind Data Model to Label
           
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#FFFFFF">
  <mx:Model id="contactmodel">
    <contact>
      <fname>First</fname>
      <lname>Last</lname>
      <address>101 St.</address>
      <city>My City</city>
      <state>NY</state>
      <zip>11111</zip>
      <phone>516-555-9999</phone>
      <email>pro@gmail.com</email>
    </contact>
  </mx:Model>
  <mx:Panel title="Contact Info" width="200" height="170">
    <mx:Label text="{contactmodel.fname} {contactmodel.lname}" />
    <mx:Label text="{contactmodel.address}" />
    <mx:Label text="{contactmodel.city} {contactmodel.state}, {contactmodel.zip}" />
    <mx:Label text="{contactmodel.phone}" />
    <mx:Label text="{contactmodel.email}" />
  </mx:Panel>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Define Data Model in Model tag and use it with LabelDefine Data Model in Model tag and use it with Label
2.Use categoryField property to point to the field in the data provider that contains the labels for the axisUse categoryField property to point to the field in the data provider that contains the labels for the axis
3.Generates data labels for a PieSeries object that include data and formattingGenerates data labels for a PieSeries object that include data and formatting
4.Add an axis solely for the purpose of adding the label to the DataTipAdd an axis solely for the purpose of adding the label to the DataTip
5.Use the updateDataChild() method to add a label to a single data point on the lineUse the updateDataChild() method to add a label to a single data point on the line
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.