(This tag must be placed inside an <EventHandlers> tag or a <MessageHandlers> tag)
The DataCopier tag allows you to save values into some object. A possible storage is the "data" object available while the sequence is running.
<DataCopier destination="data" destinationKey="someProperty" source="result" sourceKey="someProperty" />
The DataCopier tags is a handy tag to quickly copy values from a source into some storage. You can use the event handlers scope "data" as a temporary storage from where handlers that follow in the list can read values. You can also use some other external variable as the storage.
Attributes
source
The source attribute specifies where to get the data to copy from. It can be one of this options:
- event
- data
- result
- fault
- lastReturn
- message
- scope
- currentEvent (maybe the same or different from the event if the tag is placed inside a resultHandlers block, faultHandlers block or any handlers block other than EventHandlers and MessageHandlers.
or another object. If you wish to specify another object, you need to use bindings:
<DataCopier source="{myModel}" ... />
sourceKey
If you need a property from the source instead of the source itself, you need to specify this attribute.
destination
The destination attribute specifies where to place the data. It can be one of this options:
- event
- data
- result
or another object.
<DataCopier destination="{myModel}" ... />
destinationKey
If you want to set the value of a property of the destination object, instead of the destination itself, you need to specify this attribute.
Also, how would one use the scope and data attributes?
How would I copy from a property called text from a custom event of type StatusBarEvent to an mx:Label's text property with id statusMsg? Here is my best guess:
<EventHandlers type="{StatusBarEvent}">
<DataCopier
destination="statusMsg"
destinationKey="text"
source="event"
sourceKey="text" />
</EventHandlers>