Class finesse.interfaces.RestObjectHandlers
This "interface" defines REST Object callback handlers, passed as an argument to
Object getter methods in cases where the Object is going to be created.
Defined in: finesse.js.
Constructor Attributes | Constructor Name and Description |
---|---|
finesse.interfaces.RestObjectHandlers(handlers)
|
Class Detail
finesse.interfaces.RestObjectHandlers(handlers)
- Parameters:
- {Object} handlers Optional
- An object containing callback handlers for instantiation and runtime Callback to invoke upon successful instantiation, passes in REST object.
- {Function} handlers.onLoad(this) Optional
- Callback to invoke upon loading the data for the first time.
- {Function} handlers.onChange(this) Optional
- Callback to invoke upon successful update object (PUT)
- {Function} handlers.onAdd(this) Optional
- Callback to invoke upon successful update to add object (POST)
- {Function} handlers.onDelete(this) Optional
- Callback to invoke upon successful update to delete object (DELETE)
- {Function} handlers.onError(rsp) Optional
- Callback to invoke on update error (refresh or event)
as passed by finesse.restservices.RestBase.restRequest()
{
status: {Number} The HTTP status code returned
content: {String} Raw string of response
object: {Object} Parsed object of response
error: {Object} Wrapped exception that was caught
error.errorType: {String} Type of error that was caught
error.errorMessage: {String} Message associated with error
}
Note that RestCollections have two additional callback handlers:
- {Function} handlers.onCollectionAdd(this) Optional
- : when an object is added to this collection
- {Function} handlers.onCollectionDelete(this) Optional
- : when an object is removed from this collection