(This tag must be placed inside a <Dispatcher> tag)
This tag has been deprecated, please use CallBack instead.
The ServiceResponseHandler tag can be used to receive a response from an event that was dispatched from a dispatcher instance. After dispatching an event using the Dispatcher tag, the view that dispatched this event can receive a response. Those responses are sent from the EventMap within the EventHandlers block that was listening for the event dispatched by the Dispatcher.
It's important to note that this response will be received only by the view instance that dispatched the event, even if there are other instances of the same view or other views dispatch the same event.
This tag is a simple way to receive a response generated by a service call. It contains result and fault handlers you can use as you would when receiving a normal service (ie: RemoteObject) result or fault. It also contains a response handler that can be used for any general situation.
<mate:Dispatcher>
<mate:ServiceResponseHandler
result="trace(event.result)"
fault="trace(event.fault.faultString)"
response="trace(event.data)" />
</mate:Dispatcher>
Attributes
result
Event handler that receives "result" type of service responses. The event received is triggered by a ServiceResponseAnnouncer with type="result" created in the EventMap. When the ServiceResponseAnnouncer tag is placed inside a resultHandlers block, this result event will contain the following properties:
- result
- fault (null)
- data (might be null if no data was supplied in the ServiceResponseAnnouncer tag)
- any other properties set in the ServiceResponseAnnouncer by using the Properties tag.
fault
Event handler that receives "fault" type of service responses. The event received is triggered by a ServiceResponseAnnouncer with type="fault" created in the EventMap. When the ServiceResponseAnnouncer tag is placed inside a faultHandlers block, this fault event will contain the following properties:
- result (null)
- fault
- data (might be null if no data was supplied in the ServiceResponseAnnouncer tag)
any other properties set in the ServiceResponseAnnouncer by using the Properties tag.
response
Event handler that receives "response" type of service responses. The event received is triggered by a ServiceResponseAnnouncer with type="response" created in the EventMap. This event will contain the following properties:
- result (null if ServiceResponseAnnouncer was placed inside a faultHandlers block)
- fault (null if ServiceResponseAnnouncer was placed inside a resultHandlers block)
- data (might be null if no data was supplied in the ServiceResponseAnnouncer tag)
any other properties set in the ServiceResponseAnnouncer by using the Properties tag.