Tutorial: Binding components to data with Flex Builder
61
5.
Click Next to go to Step 2.
6.
In the left pane in the Add Binding - Step 2 dialog box, select the catalogWS web service.
The Flex component containing the data you want to pass to the data model is the web service.
7.
In the right pane, expand the tree control, and select result.
8.
Click Finish to create the binding.
The new binding appears in the Bindings panel.
9.
Save your work.
Send the web service request
You must specify an event that sends a request to the web service for the product data. The Flex
Store functional specification approved by the client says that the product catalog must be
displayed every time the flexstore.mxml file is opened in a browser. Therefore, you must send the
web service request when the application is initialized. You decide to write an event handler that
sends the request, and then you assign the handler to the initialization event of the application.
1.
Open the flexstore_script.as file located in the fbBindings folder.
2.
Enter the following event handler function in the ActionScript file:
function initApp() {
catalogWS.getList.send();
}
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...