Legacy documentation from help.build.one
The automatic refresh mechanism works by notifying all Datasource objects that match the currently defined tables of the RefreshScheme Attribute settings.
If the update/delete/create operations are not done using the Datasource from the repository then the correct way to handle the refresh is by ClientLogic code, triggering the refresh programmatically for the needed entity tables.
The auto refresh is handled based on refresh schemes.
Above is the default Scheme, the refresh will add the Datasource own Table name by default but you can configure and add multiple Tables in the refreshScheme.Tables.
The reposition options are default values (you are not required to define them if you need to add more tables to the refresh).
You can also change the handling on Add event, for eg. to reposition to the currently selected record, by changing the AddRepositionTo: '#KeepSelection'.
ClientSide API for calling the refresh
For a delete refresh you can call the RefreshEmitter as follows:
akioma.swat.RefreshEmitter.refreshData('eTerm*', { lastRowState: 'delete', lastUpdatedRecord: { selfhdl: 'A69:111:000008101398'} }) // This will select the next available recordFor an update refresh you can call the RefreshEmitter as follows:
akioma.swat.RefreshEmitter.refreshData('eTerm*', { lastRowState: 'update', lastUpdatedRecord: { selfhdl: 'A69:111:000008101398'} })For an add refresh you can call the RefreshEmitter as follows:
akioma.swat.RefreshEmitter.refreshData('eTerm*', { lastRowState: 'add', lastUpdatedRecord: { selfhdl: 'A69:111:000008101398'} })For the moment, only 'begins with' is supported in the wildcard.
The refresh scheme is not used to mention on which tables to refresh the data, actually the tables present in refresh schemes represent a list of listeners for the changes that will occur in the mentioned tables, which means that if an update / add / delete is done on one of the tables specified in the refresh schemes then the refresh will be done on the DSO table, not the other way around.
Starting with the SWAT 2019.23 release, also SkipRefresh parameters are available.
- AddSkipRefresh
- UpdateSkipRefresh
- RemoveSkipRefresh
These params are a comma separated list of table names which will be ignored/skipped upon refresh. Wildcards still work for the skipRefresh lists. If the developer want's to skip all, he/she can add * (star/asterisk).
The SkipRefresh settings are used to ignore the publishing refresh(data fetch) that occurs when refreshing DataSource objects that are linked to other DataSource objects.
Starting with SWAT 2020.01 release, also the RepositionToKey parameter was added, to specify what field to use from the BE for the reposition (eg: what record from a grid)
{
'Tables': 'Table1*,Table2*',
'AddRepositionTo': '#NewRecord,#KeepSelection',
'UpdateRepositionTo':'#KeepSelection,#KeepSelection',
'RemoveRepositionTo': '#NextRow,#KeepSelection' ,
'RepositionToKey' : 'selfhdl,user_key'
}Starting with 2020.13, a new parameter refreshConditionCallback is available, support for callback refreshScheme method:
{
"Tables" : "Table1,Table2",
"UpdateSkipRefresh": "Table2",
"RefreshConditionCallback":"akioma.Function_Name(eventSource)"
}Starting with 24.10, a new configuration option is available for additional logger messages to help with debugging DataSource refresh fetch actions.
window.b1.v2.config.dataSource.enableRefreshSchemeLogs = true;Back to Documentation
Back to Build.One Help-Center Home