I have the following code in the file WorkOrderCreateController.js
, which I implemented so that when a Work Order (WO) is created, a specific query called "otcreadasrsinmpasignado" is executed to update the corresponding data.
const dsName = Device.get().isMaximoMobile ? "otcreadasrsinmpasignado" : "otcreadasrsinmpasignado";
this.page.state.selectedDS = dsName;
this.app.state.selectedWoListDs="otcreadasrsinmpasignado";
let seldatasource = this.page.datasources[this.app.state.selectedWoListDs];
const forceSyncingData = this.app.state.networkConnected;
if (seldatasource) {
seldatasource.clearState();
seldatasource.resetState();
await seldatasource.load({ noCache: true,forceSync: forceSyncingData, itemUrl: "" });
//await seldatasource.load({ noCache: true, itemUrl: "" });
}
The functionality works correctly: when the WO is created, the query is triggered and the data is updated. However, the problem is that when accessing the "otcreadasrsinmpasignado" query from this code, the system starts downloading the data, but initially displays a message saying "no data exists", until it finishes reloading. After that, it does return the data correctly.
Is there a way to make the refresh behave as if we manually pressed the refresh button on the list? That is, to visually show the loading icon in motion and avoid temporarily showing that there is no data.
------------------------------
Sergio Vela
------------------------------