Name

DataGlue.bindFormatStrings( ) Method

Synopsis

DataGlue.bindFormatStrings(dataConsumer, dataProvider, labelString, dataString)

Arguments

dataConsumer

The field that you want to sort the RecordSet object by.

dataProvider

The direction to sort the recordset. "DESC" specifies a descending sort; anything else is ascending.

labelString

The label that will show in the UI component.

dataString

The data that will correspond to the label in the UI component.

Description

The DataGlue object contains two methods for binding data to a UI component. The bindFormatFunction( ) method is best used when the data coming from the recordset or other data provider has to be formatted in a particular way. If the data can be used directly, the bindFormatStrings( ) method is easier to use because you don’t have to define a custom function that formats the data. Simply specify the fields to use for the label and data properties of the data consumer in the method call.

Example

The following example code assumes a combo box named allProducts_cb is present on the main timeline:

#include "NetServices.as"
#include "DataGlue.as"

// Initialize the connection and service objects.
if (connected == null) {
  connected = true;
  NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway");
  var my_conn = NetServices.createGatewayConnection( );
  var myService = my_conn.getService("com.oreilly.frdg.searchProducts", this);
}
// The remote getSearchResult( ) method (not shown) returns a recordset. myService.getSearchResult( ...

Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.