Cancelling Smart Data Source Read Requests
Cancelling Smart Data Source Read Requests
The Smart Data Source provides an easy way to cancel ongoing read requests made to the backend.
This functionality is useful when the response time is high and the user decides to cancel.
Sample usage within a custom Angular Smart Form:
customerDataSource!: SmartDataSource;
constructor(injector: Injector,
private dataSourceRegistry: DataSourceRegistry) {
super(injector);
}
ngOnInit() {
// Obtain and store a reference to the data source
this.dataSourceRegistry.getDataSourceAsObservable('CustomerDataSource')
.subscribe(dataSource => this.customerDataSource = dataSource);
super.ngOnInit();
}
// This method can be bound to either from a JSON layout or a HTML template
cancel() {
this.customerDataSource.cancelCurrentRequest();
}
Note: To cancel read operations, this must be enabled at the Smart Data Source Level.
Enabling Cancelable Requests (HTML):
<smart-data-source
smart-filter-source='salesrepFilter'
smart-object-name='salesrepDataSource'
smart-business-entity-name="Consultingwerk.SmartComponentsDemo.OERA.Sports2000.SalesRepBusinessEntity"
smart-entity-table="eSalesrep"
smart-navigation-source="salesrepToolbar"
smart-read-requests-cancellable="true">
</smart-data-source>
Enabling Cancelable Requests (JSON Layout):
{
"dataSources": {
"customerDataSource": {
"objectName": "customerDataSource",
"entityName": "Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity",
"tableRef": "eCustomer",
"entityView": "eSalesrep",
"readRequestsCancellable": true
}
}
}
, multiple selections available,
Related content
Smart Data Source Registry
Smart Data Source Registry
More like this
Smart Data Source
Smart Data Source
More like this
Invoking Named Queries using the Smart Data Source
Invoking Named Queries using the Smart Data Source
More like this
Smart Repository Form De-activate Datasources
Smart Repository Form De-activate Datasources
More like this
Smart Navigation Service
Smart Navigation Service
More like this
Release Notes 18.0.001
Release Notes 18.0.001
More like this