Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

The auto refresh is handled based on refresh schemes.

Example of a Refresh Scheme
// working with one table
{
	"Tables": "Table1*", // table name or comma separated list of multiple tables names
	"AddRepositionTo": '#NewRecord', // default reposition to newly created record (other options: #KeepSelection, #NextRow)
	"UpdateRepositionTo":'#KeepSelection', // default keeps selection of the selected record (other options: #NextRow)
	"RemoveRepositionTo": '#NextRow' // default reposition to next available record using #NextRow
}
??
// working with multiple tables
// In addition to just setting one option for the RepositionTo handling, you are able to setup multiple options per Table listener
// Recommendation: if you define multiple tables, it's best practice to define the RepositionTo handle for all of them
{
    "Tables": "Table1*,Table2*", 
    "AddRepositionTo": "#NewRecord,#KeepSelection", //default reposition to newly created record
    "UpdateRepositionTo":"#KeepSelection,#KeepSelection", // default keeps selection of the selected record
    "RemoveRepositionTo": "#NextRow,#KeepSelection" // default reposition to next available record using #NextRow
}


Above is the default Scheme, the refresh will add the BEs own entityTable by default and you can 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' }) // This will select the next available record

For an update refresh you can call the RefreshEmitter as follows:

akioma.swat.RefreshEmitter.refreshData('eTerm*', { lastRowState: 'update' })

For an add refresh you can call the RefreshEmitter as follows:

akioma.swat.RefreshEmitter.refreshData('eTerm*', { lastRowState: 'add', lastUpdatedRecord: { selfhdl: 'A69:111:000008101398'} })

Wildcard support is available, as you can see in the above examples where using 'eTerm*'

For the moment, only 'begins with' is supported in the wildcard.

Good to know

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.

 



  • No labels