Adobe COLDFUSION 9 Manual page 703

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
#include "NetServices.as"
function search()
{
// The search() method is defined in the server-side AS file
directoryService.search(firstName.text, lastName.text);
dataView.setDataProvider(null);
status.text = "waiting...";
}
Reviewing the code
The following table describes the code and its function:
Code
directoryService.search
(firstName.text, lastName.text);
dataView.setDataProvider
(null);
status.text = "waiting...";
Capturing Flash Remoting service results
When you create a function that calls a server-side ActionScript function, also create a function to handle the data
returned by server-side ActionScript. Define the function with the same name as the function making the initial call,
but you append
to the name.
_Result
For example, if you create a function called
returned data; declare the results function as
In the following example, the results function
dataView.setDataProvider
function search_Result(resultset)
{
dataView.setDataProvider(resultset);
status.text = (0+resultset.getLength())+" names found.";
}
Reviewing the code
The following table describes the code and its function:
Code
function search_Result
(resultset)
dataView.setDataProvider
(resultset);
status.text = (0+resultset.
getLength())+" names found.";
Description
Passes the contents of the firstName and lastName text boxes to server-side
ActionScript.
Clears the
Displays a message in the status text box while the record set is being
retrieved from server-side ActionScript.
to return query data, you define a results function to handle
basicQuery
basicQuery_Result
search_Result
function:
Description
The
_Result
the search function to this function.
Assigns the results returned by the Flash Remoting service to the
list box.
Displays the number of records returned by the Flash Remoting service.
Last updated 8/5/2010
dataView
list box component.
.
supplies the record set to the
suffix tells the Flash Remoting service to return the results of
698
dataView

Advertisement

Table of Contents
loading

Table of Contents