javascriptoracle-apexscroll-positionoracle-apex-18.2

Oracle Apex Interactive Report not refreshing after restoring Scroll Position


I've been trying to add a function to keep the scroll position of an Interactive Report on Oracle Apex, and it seems to have worked.

Problem is, I had to remove a "Dialog Closed" dynamic action because its Refresh was coinciding with my javascript function (that had the restore scroll position code). Now I manage to keep the scroll position, but the report isn't refreshed whenever I leave the dialog page, forcing me to refresh the page in order to see the changes, which defeats the point of saving the scroll position.

$(window).scrollTop(scrollPosition);

Dynamic action:

enter image description here

Dynamic action menu with After Refresh setting

enter image description here

True action with javascript code

enter image description here

I tried adding a refresh action in javascript as well, right after the page gets the scroll position set, but it didn't work either, sending me back to the top of the page. It does the same if I put the refresh action before the scroll position action.

apex.event.trigger("#region_ir","apexrefresh");

Is there any way to have the report be refreshed/updated with the changes either before or after the scroll position restoration function triggers?


Solution

  • I found the solution to it.

    A Dialog Closed Dynamic Action with a Refresh True Action is necessary. Then use the dynamic action with the scroll position function, that triggers After Refresh.

    The problem I had was the jQuery identifier I was using to trigger the function that saves the scroll position when entering the dialog page.