Home Flex Dataprovider List Control with Data Provider



List Control with Data Provider
Posted on: November 16, 2009 at 12:00 AM
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

Related Tags for List Control with Data Provider:


More Tutorials from this section

Ask Questions?    Discuss: List Control with Data Provider  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.