
Tutorial: Binding components to data with Flex Builder
41
6.
Expand the tree control in the Data panel to inspect the web service.
The catalogWS web service has one method called getList that returns an array.
Bind the web service to a data model
A Flex data model provides a convenient way to refer to and manipulate data in Flex applications.
For the Flex Store, you decide to create a data model and bind it to the product data returned by
the web service.
1.
Make sure your flexstore.mxml file is open in Flex Builder.
2.
Switch to Code view, and insert a data model by entering the following lines after the closing
</mx:WebService>
tag:
<mx:Model id="catalog">
</mx:Model>
3.
Switch to Design view.
The new catalog model appears in the Data panel.
4.
Select the catalog model in the Data panel, and then, in the Bindings panel in the Tag inspector,
click the Plus (+) button.
The Add Binding - Step 1 dialog box appears. Make sure the first option is selected:
This option specifies the destination of the data. In this case, the destination is the data model
called catalog.
5.
Click Next to go to Step 2.
Summary of Contents for FLEX-FLEX BUILDER
Page 56: ...56 Flex Builder Tutorials...