
107
9
CHAPTER 9
Retrieve and Display Data
To provide data to your application, Adobe Flex includes components designed specifically for
interacting with HTTP servers, web services, or remote object services (Java objects). These
components are called remote procedure call (RPC) service components.
Unlike web applications built with Adobe ColdFusion, PHP, or similar server technologies,
Flex applications cannot connect directly to a database. They interact with data using services.
For example, you can insert an HTTP service in a Flex file to interact with a ColdFusion file
that retrieves data from a MySQL database, converts it to XML, and then feeds it to your Flex
application.
In this lesson, you create a simple blog reader that retrieves recent posts and lets users read the
first few lines of the posts. You use an RPC service component called HTTPService to retrieve
data from an RSS feed, and then you bind the data to a Label, DataGrid, TextArea, and
LinkButton control.
In this lesson, you’ll complete the following tasks:
Set up your project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Review your access to remote data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Insert and position the blog reader controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Insert a HTTPService component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112
Populate a DataGrid control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
Display a selected item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Create a dynamic link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118
Kommentare zu diesen Handbüchern