CodeCoupler UI DataSource Mixin "Repeating"
Part of the
CodeCoupler UI Pro package.
A DataSource Mixin with special request handling.
This DataSource handle the settings
trasport.update different. If the request fails a callback function will be called and afterwards
the request will be repeated. You can filter the status code in which the callback will be used.
This is usefull to intercept unauthorized requests, provide a login procedure to the user and then continue with the work.
The default behaviour is to intercept returned status code 401 and execute the system method
The difference to bind a function to the
error event is that the DataSource will not reject the
request all the time. This means that the calling functions will not stop working. They wait until
the request process all the repetitions.
The callback function must be
async and in case the promise will be rejected the whole request
leads to an error.
To configure this feature you can use new properties added to the
If not set, repeting functionality will be disabled. Must be a function to call if an specified status code will be returned.
The function must be
asyncand therefore return a
Promise. If rejected the current CRUD operation will be canceled. Otherwise the DataSource will repeat the current operation.
The default method is to call the system method
The current datasource that calls the function.
The result object of the Ajax call as argument.
The message that will be used by the default method defined in
repeatProcessto call the
Array of status codes with which the callback will be used. If
nullthe callback will always be used.