Hi Isomorphic,
it seems that as of today, for big clientside delete requests, you have to fake something like this, where you abuse a FETCH operationBinding for the sole purpose of transferring criteria for the REMOVE request to the server.
I would be good if there was support to send a REMOVE request with criteria instead of with PK values / record.
At least, if this is the best practice for the use case, this should be mentioned somewhere. Is it the best practice?
Current docs excerpt for the DSRequest.setCriteria() that I'd like to use inside of DataSource.removeData()
Best regards
Blama
it seems that as of today, for big clientside delete requests, you have to fake something like this, where you abuse a FETCH operationBinding for the sole purpose of transferring criteria for the REMOVE request to the server.
I would be good if there was support to send a REMOVE request with criteria instead of with PK values / record.
At least, if this is the best practice for the use case, this should be mentioned somewhere. Is it the best practice?
Code:
if (buttonTitle.equals(I18nEdited.deleteAll())) { resellerSalesareaDS.removeData(new Record(), null, new DSRequest() { { setOperationId(OperationIdEnum.T_RESELLER_SALESAREA__REMOVEALL.getValue()); } }); } else if (buttonTitle.equals(I18nEdited.deleteShown())) { resellerSalesareaDS.[B]fetchData[/B](salesareaGrid.getFilterEditorCriteriaAsAdvancedCriteria(), null, new DSRequest() { [B]//is FETCH request in order to transport criteria to the server, does a REMOVE on the server instead with this criteria.[/B] { setOperationId(OperationIdEnum.T_RESELLER_SALESAREA__REMOVESHOWN.getValue()); } }); ; }
Code:
This method applies to "fetch" requests only; for update or delete operations pass a Record to setData() which contains primaryKey values as Record attributes.
Blama
Comment