Working with Flex data services
139
Flex Builder doesn’t retrieve and display the schema of HTTP services or remote objects, so
you’ll need to know the source property of these services in advance and specify it in the
Binding Source text box. The Binding Source text box shows the binding expression Flex
Builder will insert in the code. For more information, see “Binding data” in Developing Flex
Applications Help.
5.
Click Next.
The Add Binding - Step 2 dialog box appears.
6.
Select the destination of the data supplied by the data service.
The destination can be the property of a component or data model.
For example, if you have a Label component that you want to use to display the current
temperature, select the Label component in the left pane and then select the text:String
property in the right pane.
7.
Click Finish to create the binding.
The new binding appears in the Bindings panel.
8.
Create an event handler to call the data service.
You can create this event handler rapidly with Flex Builder. For instructions, see
“Calling the
data service” on page 141
.
Passing data to a Flex data service
You can create bindings to pass data to Flex data services. For example, you can create a binding
to pass a zip code to a web service so that you can obtain the current temperature at that zip code
location.
To create a binding to pass data to a data service:
1.
Make sure your MXML file contains a component or data model that can supply data to the
data service.
For example, your file can have a TextInput component that lets users enter a zip code.
2.
In the Data panel, select the Flex data service.
To add a data service to the panel, see
“Inserting a Flex data service in the MXML file”
on page 136
.
3.
In the Bindings panel (Window > Bindings), click the Plus (+) button.
The Add Binding - Step 1 dialog box appears.
Summary of Contents for FLEX BUILDER-USING FLEX BUILDER
Page 1: ...Using Flex Builder...
Page 116: ...116 Chapter 4 Building a Flex User Interface Visually...
Page 144: ...144 Chapter 6 Working with Data...
Page 154: ...154 Appendix A Basic Flex Concepts...