Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Flex Dataprovider List Control with Data Provider

Related Tutorials


 
 

Share on Google+Share on Google+

List Control with Data Provider

Advertisement
List is the very basic control to the developers. It displays the data as the vertical list of items.

List Control with Data Provider

     

List is the very basic control to the developers. It displays the data as the vertical list of items. It can be used in several conditions since it can have almost all kind of data( i.e anything from image to text). It is used by the programmer in all application from a small application to large scale application.

In this example we have created a simple List with the dataprovider property. The dataprovider property's value contains the value of  set of data objects. Here we have created data object with the help of ArrayCollection. This array collection "dayList" contains 7 items. Here is the full source code :


<?xml version=
"1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
  
layout="absolute" width="373" height="272">
  <mx:ArrayCollection id="daylist">
  <mx:source>
  <mx:Object label="Mon" data="Monday"/>
  <mx:Object label="Tue" data="Tuesday"/>
  <mx:Object label="Wed" data="Wednesday"/>
  <mx:Object label="Thu" data="Thursday"/>
  <mx:Object label="Fri" data="Friday"/>
  <mx:Object label="Sat" data="Saturday"/>
  <mx:Object label="Sun" data="Sunday"/>
  </mx:source>
  </mx:ArrayCollection> 
  <mx:Panel x="10" y="10" width="353" height="252" layout="absolute" 
  
title="List with Data Provider Example">
  <mx:List x="10" y="10" width="313" height="170" dataProvider="{daylist}" >
  </mx:List>
  </mx:Panel>  
</mx:Application>

Output :

Watch in action :

Download Source Code

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 16, 2009

Related Tutorials

Discuss: List Control with Data Provider  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com