Chapter 8. Using Data Binding

IN THIS CHAPTER

What Is Data Binding?

Applying Data Binding

Two-Way Bindings

Handling Complex Data with Data Models

When Data Binding Isn’t Appropriate

Summary

“Some things never change.”

Popular expression

It’s difficult to imagine a future where data could be more dynamic than it is in the early 21st century. Here’s a compelling thought: what percentage of the information in our lives can we classify according to its timestamp?

Like data in the world, data in our applications also changes quickly. Sometimes those changes originate on the Internet in the form of stock quotes, weather information, RSS feeds, even tweets. Yet, at other times, data dynamics come entirely from our own creations. Whatever the case, one thing is certain: you want your applications to listen for and react to such changes in data.

Fortunately, thanks to something called data binding, it’s easy to work with dynamic data in Flex. As you’ll soon see, data binding is easy to implement, and once you’re comfortable with it, you’ll find yourself using it frequently as a means of handling data in your applications.

What Is Data Binding?

By its name, data binding implies multiple values bound together so that a change to one value affects the other. Data binding typically occurs in one direction and involves unique source and destination values. If the source value changes, data binding imposes changes on the destination value. Flex also offers two-way, or bidirectional, data binding. For two-way ...

Get Learning Flex 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.