I’m working with an Interactive Grid where I’ve enabled
function( options ) {
  options.defaultGridViewOptions = {
       persistSelection: true,
      selectionStateItem: 'P53_SELECTION_STATE'
  };
  return options;
}
What I notice:
- Select All applies only to the current page.
- With persistSelection:true, APEX correctly remembers the selection across multiple pages.
- However, the page item defined in selectionStateItem(P53_SELECTION_STATE) is only populated with the selection state of the currently loaded page.
Example:
- Go to page 3, deselect 2 rows.
- Switch to page 1, click Select All.
- When I check P53_SELECTION_STATE, it does not reflect the deselections from page 3.
- Only after I go back to page 3 does the item get updated correctly.
So it seems the item is updated only when a page is loaded, not when changes are made on other pages.
Question:
Is there a way to have selectionStateItem reflect the true global selection state immediately (without the user having to revisit each page)? Or do I need to implement my own custom tracking logic with JavaScript and a global Set of PKs?
Any suggestions or best practices are highly appreciated!