Bind The Gridview Component To The Data - MACROMEDIA FLEX BUILDER-USING FLEX BUILDER Use Manual

Table of Contents

Advertisement

Click the final WebServer event (onResult) and inspect the information in the right pane.
5.
If the application successfully called the web service when it was initialized, then the data for
the product catalog should appear in the right pane. Note how the Network Monitor converts
the raw data passed between the server and the application into ActionScript. Scroll down to
view the catalog data passed to the application.
This confirms that the web service is called when the application is initialized and the catalog
data is passed to the application.
Disable the Network Monitor for now by clicking the Enable Flex Network Monitor checkbox
6.
again.
For more information on using the Network Monitor, see
monitoring interactions with the server" on page

Bind the GridView component to the data

After specifying where and when to retrieve the data, and then verifying that the data is passed to
the application, you can use the data to populate the GridView component.
Open the GridView.mxml file located in the fbBindings folder.
1.
In Code view, enter the following script block after the opening
2.
variable called dataObject:
<mx:Script>
var dataObject;
</mx:Script>
By creating a variable called dataObject, you create a property for the component. You can use
this new property in the GridView tag to pass data to the GridView component. For example,
you can write the following tag in another MXML file:
<local:GridView xmlns:local="*" dataObject="somevalue"...>
The value is passed to the component and stored in the dataObject variable.
Note: If you use Code hints to write this script block, Flex Builder automatically inserts a CDATA
block for you. You can declare the variable in this block. For more information on CDATA blocks,
see
"About ActionScript files in Flex applications" on page
Locate the
3.
<mx:DataGrid>
<mx:DataGrid id="list"
dataProvider="{dataObject}"
...
The data stored in the dataObject variable is used in the DataGrid control.
91.
tag in the file and add the following property (shown in bold type):
Tutorial: Binding components to data with Flex Builder
"Debugging applications by
tag to declare a
<mx:VBox>
147.
63

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX BUILDER-USING FLEX BUILDER and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex builder

Table of Contents