RecordSet.getNumberAvailable( )

RecordSet.getNumberAvailable( ) MethodFlash 6

returns the number of records downloaded from the server
myRecordSet.getNumberAvailable( )


An integer specifying the number of records that have currently downloaded from the server.


The getNumberAvailable( ) method allows the developer to retrieve a count of how many records have been downloaded from the server when utilizing pageable resultsets from a ColdFusion MX Server. For example, if you are retrieving a resultset of 53 records in pages of 10, the getNumberAvailable( ) method tells you how many records are available on the client upon calling the method. In this case, the method will return 10, 20, 30, 40, 50, or 53, depending on when it is called.

If the getNumberAvailable( ) method returns the same number as the getLength( ) method, the entire recordset is populated. You can also use the isFullyPopulated( ) method to determine if the recordset is completely populated.


The following code demonstrates the getNumberAvailable( ) method:

trace(myRecordset_rs.getNumberAvailable( ));

As of this writing, the getNumberAvailable( ) method works only in the ColdFusion implementation of Flash Remoting when employing pageable recordsets. It might typically be called within a handler that executes repeatedly, such as an onEnterFrame( ) handler. But you can use addView( ) to be notified when all rows have downloaded (see the "allRows" event in Table 15-3).

Chapter 5 contains a more complete example in the context of a ColdFusion application.

See Also

RecordSet.addView( ), RecordSet.getLength( ), RecordSet.isFullyPopulated( ), RecordSet.setDeliveryMode( ); Chapter 4 and Chapter 5

    Part III: Advanced Flash Remoting