Using data binding with data models : Data Binding « Data Model « Flex






Using data binding with data models

Using data binding with data models
            
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Model id="reg">
    <registration>
      <name>{fullname.text}</name>
      <email>{email.text}</email>
      <phone>{phone.text}</phone>
      <zip>{zip.text}</zip>
      <ssn>{ssn.text}</ssn>
    </registration>
  </mx:Model>
  <mx:Form>
    <mx:FormItem label="Name" required="true">
      <mx:TextInput id="fullname" width="200" />
    </mx:FormItem>
    <mx:FormItem label="Email" required="true">
      <mx:TextInput id="email" width="200" />
    </mx:FormItem>
    <mx:FormItem label="Phone" required="true">
      <mx:TextInput id="phone" width="200" />
    </mx:FormItem>
    <mx:FormItem label="Zip" required="true">
      <mx:TextInput id="zip" width="60" />
    </mx:FormItem>
    <mx:FormItem label="Social Security" required="true">
      <mx:TextInput id="ssn" width="200" />
    </mx:FormItem>
  </mx:Form>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Using binding to do an automatic copy to a targetUsing binding to do an automatic copy to a target
2.Making your own bindable variable and bind to TextInputMaking your own bindable variable and bind to TextInput
3.Binding CurlyBinding Curly
4.Bind Data To ModelBind Data To Model
5.Databinding EffectsDatabinding Effects
6.Set enabled property of Validator using data bindingSet enabled property of Validator using data binding
7.Use validator with data binding to validate either the source or destination of the data bindingUse validator with data binding to validate either the source or destination of the data binding
8.Implementing Two-Way BindingsImplementing Two-Way Bindings
9.Implementing Two-Way Bindings with Implementing Two-Way Bindings with <mx:Binding/>
10.Modify Label text through data binding
11.Applying behaviors in MXML using data bindingApplying behaviors in MXML using data binding
12.Use data binding to specify information to the value propertyUse data binding to specify information to the value property
13.data binding between Model and Form controlsdata binding between Model and Form controls
14.Include ActionScript code and E4X expressions as part of the data binding expressionsInclude ActionScript code and E4X expressions as part of the data binding expressions
15.The curly braces syntax and the tag both define a data binding at compile timeThe curly braces syntax and the <mx:Binding> tag both define a data binding at compile time
16.Curly braces syntax and tag both define a data binding at compile timeCurly braces syntax and <fx:Binding> tag both define a data binding at compile time
17.Make maxFontSize and minFontSize properties that you defined as variables usable as the sources for data bindings expressionsMake maxFontSize and minFontSize properties that you defined as variables usable as the sources for data bindings expressions
18.Data binding examplesUsing data binding with data modelsData binding examplesUsing data binding with data models
19.Data Binding Using Curly Braces SyntaxData Binding Using Curly Braces Syntax
20.Data Validation Through Data BindingsData Validation Through Data Bindings
21.Data Binding Through ActionScript ExpressionsData Binding Through ActionScript Expressions
22.Data Binding Using the Tag in MXML SyntaxData Binding Using the <mx:Binding> Tag in MXML Syntax
23.Use custom function during data bindingUse custom function during data binding
24.Use data binding to make your chart reflect data changes in real time.Use data binding to make your chart reflect data changes in real time.
25.Value With Data BindingValue With Data Binding
26.Value Trigger With Data Binding On ModelValue Trigger With Data Binding On Model
27.Value Trigger With Data Binding for Complex ModelValue Trigger With Data Binding for Complex Model
28.Set the enabled property by using data bindingSet the enabled property by using data binding
29.Using Timer to fire data binding eventUsing Timer to fire data binding event
30.MXML bindingMXML binding
31.Binding control property to a property of another controlBinding control property  to a property of another control
32.More Uses for Curly BracesMore Uses for Curly Braces
33.Using more than one set of curly bracesUsing more than one set of curly braces
34.declare bindings outside of component tagsdeclare bindings outside of component tags
35.databinding syntax escapeddatabinding syntax escaped
36.Binding With Curly BracesBinding With Curly Braces
37.Use tag as an alternative to the curly braces syntaxUse <mx:Binding> tag as an alternative to the curly braces syntax
38.Binding a source property to more than one destination propertyBinding a source property to more than one destination property
39.Defining bidirectional bindingsDefining bidirectional bindings
40.Bind with Binding tagBind with Binding tag
41.Wrap the whole string with {} during BindingWrap the whole string with {} during Binding
42. tags in the following example are valid and equivalent to each other<fx:Binding> tags in the following example are valid and equivalent to each other
43.Converting text to upper with BindingConverting text to upper with Binding
44.Use a static constant as the source for a data-binding expressionUse a static constant as the source for a data-binding expression
45.Create a String variable for bindingCreate a String variable for binding
46.Multiple Destinations bindingMultiple Destinations binding
47.Using multiple tagsUsing multiple <mx:Binding/> tags
48.Multilevel BindingsMultilevel Bindings
49.Simple Binding TestSimple Binding Test
50.Using Binding TagUsing Binding Tag
51.Create a Bidirectional BindingCreate a Bidirectional Binding
52.Create a Bidirectional Binding with Binding tagCreate a Bidirectional Binding with Binding tag
53.Bind to a Property with Binding tag
54.Property BindingProperty Binding
55.Bind to a PropertyBind to a Property
56.Using functions that take bindable properties as argumentsUsing functions that take bindable properties as arguments
57.Use Bindable Property Chains
58.Bind to a FunctionBind to a Function
59.Create Customized Bindable PropertiesCreate Customized Bindable Properties
60.A single bindable property inside curly bracesA single bindable property inside curly braces
61.Concatenate and manipulate the information inside the curly bracesConcatenate and manipulate the information inside the curly braces
62.both source and destination properties must resolve to a bindable property or property chain at compile timeboth source and destination properties must resolve to a bindable property or property chain at compile time
63.When bindable property changes, the function executes, and the result is written to the destination propertyWhen bindable property changes, the function executes, and the result is written to the destination property