
214 Use Web Services
5. Save the file, wait until Flex Builder finishes compiling the application, and then click the
Run button in the toolbar to test the application. If you’re using the plug-in configuration
of Flex Builder, select Run > Run As > Flex Application.
A browser opens and runs the application. You find a problem in the application’s default
state. The ComboBox reads Top 5 but the DataGrid does not display any information.
The DataGrid should display the top five posts, but it doesn’t because your application
hasn’t called the web service yet. The application only calls it when the ComboBox
changes. Even if you click Top 5 in the ComboBox after the application starts, the call is
still not made because the selected item hasn’t changed.
To fix the problem, you decide to also call the web service immediately after the
application is created, as follows.
6. In Source mode, enter the following creationComplete property (in bold) in the opening
<mx:Application> tag:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="wsBlogAggr.getMostPopularPosts.send()">
Commenti su questo manuale