taskSelectAll ignores focus

194 Views Asked by At
#define.taskSelectAll(778)
element.task(#taskSelectAll);

If I have more than one grid, the task always selects the same griddata altough the focus is on another grid. Is there a way to set the focus?

2

There are 2 best solutions below

0
On BEST ANSWER

Set the grid's AutoDeclaration = Yes then call this code, replacing grid1 with your actual grid control:

#define.taskSelectAll(778)

element.selectControl(grid1);
element.task(#taskSelectAll);

OR if you don't want to set the AutoDeclaration = Yes and avoid the added overhead, you can do this:

#define.taskSelectAll(778)

element.selectControl(element.control(element.controlId('Grid1')));
element.task(#taskSelectAll);
2
On

Have you tried using method FormDataSource.markRecord() to select required(/all) records?