Connecting to WebServices with the Data Centric Development (DCD) feature in Flash Builder 4 – Part 2

This is Part 2 of a 3 part series:

This is a continuation of my Web Services import which was discussed in Part 1. Once you have imported the Web Service it’s time to build the UI and bind the service to it.

Step 3 – Building the UI

Go to the design view and drag and drop a ComboBox. Right click and click on “Bind to Data”.

This throws a wizard where you can choose the service you want to bind it to, which in this case is getCountries().

Click “OK” and run the application. You should see the following

Now lets get the population details for a selected item on the combobox. This is simple. Click on the ComboBox and click “Generate Details Form”

This throws a pop-up where you can choose which operation to call on change and what to display.

It automatically redirects to the code view and ask you to provide the parameter for the getPopulation() method.

So change

protected function comboBox_changeHandler(event:ListEvent):void

{ getPopulationResult.token = populationService.getPopulation(strCountry);}

To

protected function comboBox_changeHandler(event:ListEvent):void

{getPopulationResult.token = populationService.getPopulation(comboBox.selectedItem.toString());}

Now go to design view, reposition the generated Form and run the app and we have a fully functional application served by a webservice.  Just to make it pretty, I added a prompt to the ComboBox.

In the next part, you can see a screencast of the workflow that was defined in Part 1 & Part 2.

3 Responses to Connecting to WebServices with the Data Centric Development (DCD) feature in Flash Builder 4 – Part 2

  1. […] Part 2 – Integrating the Service with UI […]

Leave a comment