Mega Code Archive

 
Categories / Flex / Data Model
 

Data Binding Using the mx

Tag in MXML Syntax" src="http://www.rntsoft.com/Code/FlexImages/DataBindingUsingthemxBindingTaginMXMLSyntax.PNG"              <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">     <mx:Model id="contacts">         <contact>             <name>                 <first>{"John"}</first>                 <last>{"Doe"}</last>             </name>         </contact>     </mx:Model>     <mx:Panel title="Use the mx:Binding tag in MXML" horizontalAlign="center">         <mx:Form>             <mx:FormItem label="First Name">                 <mx:TextInput id="firstName" />             </mx:FormItem>             <mx:FormItem label="Last Name">                 <mx:TextInput id="lastName" />             </mx:FormItem>         </mx:Form>     </mx:Panel>     <mx:Binding source="contacts.name.first" destination="firstName.text" />     <mx:Binding source="contacts.name.last" destination="lastName.text" /> </mx:Application>