Data binding with data model in Flex 3

In this example we have used data model for binding data for objects.

 
 

Share on Google+Share on Google+

Data binding with data model in Flex 3

Ads

In this example we have used data model for binding data for objects.

Data binding with data model:-

In this example we have used data model for binding data for objects.

Example:-

<?xml version="1.0"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Model id="datamodel">

<data>

<firstname>{firstname.text}</firstname>

<lastname>{lastname.text}</lastname>

</data>

</mx:Model>

<mx:TextInput id="firstname" width="200"/>

<mx:TextInput id="lastname" width="200"/>

<mx:Label text="{datamodel.firstname}"/>

<mx:Label text="{datamodel.lastname}"/>

</mx:Application>

output:-

Running Example:

Download this code

Advertisements

Posted on: July 14, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles