Accessibility

Table of Contents

Managing ColdFusion data with Adobe Flash Builder 4 beta

Configuring data return type

As mentioned in the introduction, this tutorial uses the same development environment as the Getting started with ColdFusion and Flash Builder 4 beta tutorial and the other tutorials in this series.

  1. Locate the Data/Services view in Flash Builder 4 beta. You should see the F4CF_Getting_Started_Service service shown in Figure 1.

    Verify whether the EmployeeSalesData data type has been defined.

    Figure 1. Verify whether the EmployeeSalesData data type has been defined.

  2. Expand the Data Type category. If you see the EmployeeSalesData data type listed (also shown in Figure 1), then you can skip to the next section, Mapping service calls to CRUD fucntionality.

If you do not see the data type, follow the steps below to assign your own data type name to the returned data that is retrieved in the getAllData() service call to the CFC method.

  1. Right-click the getAllData() function in the F4CF_Getting_Started_Service option of the Data/Services view and select Configure Return Type (see Figure 2).

    Confige the return type of getAllData()
function

    Figure 2. Configure the return type of getAllData() function.

    Each record from the query has been placed in an ActionScript object with each column of data (FIRSTNAME, LASTNAME, EMAIL, and so on) set in a name/value pair. Each record is indexed starting at zero.

    Note: Unlike ColdFusion, ActionScript is a zero-indexed language.

    Rather than generically referring to this returned data as an object, this wizard lets you to give the data a return type name. You will do this next.

  2. In the Configure Operation Return Type dialog box, create a new custom data type named EmployeeSalesData (see Figure 3).

    Creating a new custom data type

    Figure 3. Create a new custom data type.

  3. Click Next.
  4. Click the Yes radio button to specify that the operation needs remoting credentials.
  5. Enter your username and password in the Remote Service Authentication window (see Figure 4).

    Enter the remoting credentials for the getAllData() CFC function.

    Figure 4. Enter the remoting credentials for the getAllData() CFC function.

  6. Click Next.
  7. In the Modify Properties of Return Type dialog box, click Finish.

You will see the EmployeeSalesData data type listed in the Data Types category of the Data/Services view (see Figure 5). Note that the properties of the data type are the query columns returned from the CFC method.

<em>The data type and its properties</em>.

Figure 5. The data type and its properties.