User Guide
Advanced topics in data integration 293
@billable: String
@hours : Integer
@id : Integer
@rate : Integer
Suppose you want to treat the row node as a record within a grid, and you want the @billable
attribute to be treated as a Boolean value and show a
true or false value in the grid instead of ON
or
OFF. Getting the data into the grid is simple: You can simply bind the row schema field to the
dataProvider property of the grid. The following procedure describes how to get the @billable
attribute to be treated as a Boolean value and display a
true or false value.
To make the @billable attribute display a true or false value:
1.
Select the XMLConnector component, click the Schema tab, and select the @billable schema
field.
2.
In the bottom pane of the Schema tab, set the data type property to Boolean.
3.
Set the encoder property to Boolean.
4.
Select Encoder Options and enter on for strings that represent true, and enter off for strings
that represent
false.
The encoder now takes the XML data in its raw form (String) and converts it into an
ActionScript Boolean value. Using the encoder options, it knows how to encode the string
values correctly.
5.
Click Formatter, and select Boolean. Select Formatter Options. You now have a choice to define
how a
true and false value should appear as a string.
6.
Enter Tr u e for strings that mean true, and enter False for strings that mean false.
The formatter now takes the ActionScript Boolean value and formats it into a String.
Setting the schema path
The
path property for a schema field is an optional setting that is used in special circumstances
when the schema for your component is not appropriate. Using this setting, you can create a
virtual schema field (a field that exists in one location but pulls its value from another). The value
of this property is a path expression that is entered in one of the following formats:
• For schemas that contain ActionScript data, the path follows the format field [.field]...,
where field is equal to the name of a field (such as addresslist.street).
• For schemas that contain XML data, the path follows the format XPath, where XPath is a
standard XPath statement (such as
addressList/street).
When data binding is performed, Flash checks to see if there is a path expression for a schema
field. If so, it uses the path expression to locate the correct value. For more information, see
“Virtual schemas” on page 301.
Note: The path expression is always performed relative to the parent node of the schema field.