Macromedia flex 2-migrating applications to flex 2 Manual De Usuario

Descargar
Página de 184
105
5
CHAPTER 5
Binding
This topic describes the steps required to convert properties in your applications to be usable 
as the source for a data binding expression in Adobe Flex.
For more information binding, see Chapter 5, “Using Metadata Tags in Custom Components,” in Creating and Extending Flex 2 Components.
Contents
About binding
In Flex 1.5, it was possible to use any public property defined as a variable or Array as the 
source for a data binding expression. When a public property is the source of a data binding 
expression, Flex automatically copies its value to a destination property when the value of the 
source property changes. 
Any property can be the destination of a data binding expression. That means you do not 
have to write an special code to support the destination property of a data binding expression.
Using any property as the source for data binding is supported in Flex 2, but you must 
explicitly identify the property or the property’s class as bindable using the 
[Bindable]
 
metadata tag. The property may be defined as a variable or defined by using both a setter and 
a getter method. If you attempt to use a property as the source of a data binding expression, 
and that property does not support binding, Flex throws a warning and does not update the 
destination value of the when the source value changes.
Using Arrays and DataProviders as the source for data binding expressions in Flex 2 is not 
supported and you should convert your DataProviders to use the new Collections API. For 
more information, see 
.