About working with RecordSet objects
83
If the
config_panel
object specifies page mode, the
setDeliveryMode()
method tells Flash
Remoting to set the page size to the number of rows in the contact_grid movie clip and to
prefetch one additional page beyond the page with the requested data, if it is not in memory.
If the
config_panel
object specifies fetchall mode, the
setDeliveryMode()
method tells Flash
Remoting to set the page size to 10 records and start getting the records, one page at a time (if
they are not already on the client), until the entire record set has been fetched.
For all delivery modes, after a record is received from the application server, it is held inside the
RecordSet object. Any subsequent
getItemAt
calls immediately return the record. Any
getItemAt
calls for records that the client has not yet received fetch the requested record as soon
as possible and return a
fetch pending
message.
Using Flash UI components with RecordSet objects
Many Flash UI components can use RecordSet objects to provide both label and data
information. These components use Flash DataProvider objects to supply the following
information:
•
Label values that appear to the user
•
Corresponding data values that are available by using the component’s
getValue()
method
after the user selects a label
Objects that can use DataProvider objects are often referred to as
data consumers
. Flash
components that can be data consumers currently include the following:
•
ComboBox
•
DataGrid
•
ListBox
Additional UI objects might be available at the Macromedia Flash Exchange at
http://
dynamic.macromedia.com/go/fl_exchange
.
The following sections describe how to use the RecordSet objects with these components.
Using RecordSet objects directly
You can use RecordSet objects directly in the
dataProvider
property of a data consumer
component to specify that the RecordSet object provides the component’s values.
The following example is a result handler for a
getProductList()
service function that gets a
single-column record set that contains product names. It populates a ListBox component with the
returned RecordSet object’s records:
function getProductList_Result (resultEvent:mx.rpc.ResultEvent):Void
{
catalogListBox.dataProvider = resultEvent.result);
}
catalogService.getProductList();