Reputation: 1230
I am opening detail of an item in list page grid. There may be some changes so after detail is close() I and refreshing the list page datasource.
I am acessing the list page datasource from arguments
FormDataSource callerDataSource;
callerDataSource = element.args().record().dataSource();
But I can obtain one of following results.
1) I reread() the current record.
callerDataSource.reread();
The data in grid are changed but the form parts do not refresh.
2) I research(true) the datasource
callerDataSource.research(true);
I try even this version of research
callerDataSource.reread();
callerDataSource.rereadReferenceDataSources();
callerDataSource.research(true);
but I lost focus in grid.
3) I call task F5 by
#Task
Element.args().caller().task(#taskF5);
but the focus is lost here too.
I would like to have new data in grid and in form part but do not lost focus in grid. (Refreshing of only selected record and info parts which depends on it will be enough.)
The table has primary index selected. It is recid (which is not shown in grid).
How can I do it?
Upvotes: 0
Views: 2536
Reputation: 1230
Never mind I find this blog
My solution is use the position
FormDataSource callerDataSource;
int position;
callerDataSource = element.args().record().dataSource();
position = callerDataSource.getPosition();
callerDataSource.reread();
callerDataSource.research(true);
callerDataSource.setPosition(position);
Upvotes: 2