RestCollectionBase Common Parameters
The RestCollectionBase objects are automatically created by the Finesse JavaScript Library when applicable APIs are used. Thus, the RestCollectionBase objects do not have to be initialized manually. The RestCollectionBase class extends the RestBase and supports all the handlers of RestBase.
The RestCollectionBase extends RestBase class. Hence, all the common parameters of the RestBase applies to RestCollectionBase.
Fields borrowed from class finesse.restservices.RestBase
: ajaxRequestTimeout, restResponseStatus.
Methods borrowed from class finesse.restservices.RestCollectionBase
: getCollection, refresh.
Methods borrowed from class finesse.restservices.RestBase
: addHandler, getData, getId, getProperty, hasProperty, isLoaded, removeHandler.
Example of Common Configurations
Parameter | Description | Example |
---|---|---|
onLoad |
A callback that is invoked one time in the life of the object, which is when the initialization is successful and the data is loaded into the JavaScript object successfully. This JavaScript object is then passed to the handler as a parameter. This is equivalent to the success handler of a GET REST API request. |
An example, on User load which lists all the associated Dialogs in a grid: |
onCollectionAdd |
A callback that is invoked when a new object is added to the collection. The newly added object is then passed to the handler as a parameter. |
An example, on User load which lists all the associated Dialogs in a grid, and updates them as and when a new Dialog is added: |
onCollectionDelete |
A callback that is invoked when an object is removed from the collection. The removed object is then passed to the handler as a parameter. |
An example, on User load which lists all the associated Dialogs in a grid, and updates them as and when a new Dialog is removed: |
onError |
A callback that is invoked with the response object as the parameter when any of the operations such as, GET, PUT, POST and DELETE fails. For more information on parameters, see RestBase Common Parameters. |
An example when the operations fail: |