| Contents > Developing ColdFusion MX Applications > Using the Flash Remoting Service > Using the Flash Remoting service with ColdFusion pages > Returning records in increments to Flash |
|
|
|
|
||
ColdFusion lets you return record set results to Flash in increments. For example, if a query returns 20 records, you can set the Flash.Pagesize variable to return five records at a time to Flash. Incremental record sets lets you minimize the time that Flash application waits for the application server data to load.
<cfparam name="pagesize" default="10">
<cfif IsDefined("Flash.Params")>
<cfset pagesize = Flash.Params[1]>
</cfif>
<cfquery name="myQuery" datasource="ExampleApps">
SELECT *
FROM tblParks
</cfquery>
<cfset Flash.Pagesize = pagesize>
<cfset Flash.Result = myQuery>
In this example, if a single parameter is passed from the Flash application, the pagesize variable is set to the value of the Flash.Params[1] variable, otherwise the default is set to 10. Next, a cfquery statement queries the database. After that, the pagesize variable is assigned into the Flash.Pagesize variable. Finally, the query results are assigned into the Flash.Result variable, which is returned to Flash.
When you assign a value to the Flash.Pagesize variable, you are specifying that if the record set has more than a certain number of records, the record set becomes pageable and returns the number of records specified in the Flash.Pagesize. For example:
include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
gatewayConnection = NetServices.createGatewayConnection();
CFMService = gatewayConnection.getService("helloExamples", this);
CFMService.getData();
After the initial delivery of records, the RecordSet ActionScript class becomes responsible for fetching records. You can configure the client-side RecordSet object to fetch records in various ways using the setDeliveryMode ActionScript function.
|
|
||
| Contents > Developing ColdFusion MX Applications > Using the Flash Remoting Service > Using the Flash Remoting service with ColdFusion pages > Returning records in increments to Flash |
|
|
ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/usingsa7.htm