In this example we have used data model for binding data for objects.
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: