Refresh action on page with temporary table

SillysodSillysod Member Posts: 4
edited 2014-05-29 in NAV Three Tier
Hi guys

I have a page who's source table is temporary

I load data into this temp table in onOpenPage

Now my issue is that I want the user to be able to refresh the data shown, on a list page where the table isn't temporary the user can just click the Refresh action which shows on every page
Obviously this doesn't work for my page.

I can't find any sort of OnRefresh trigger, so I can only see one option, adding another page action called Reload but this seems counter intuitive from a users point of view?
If I could hide the standard refresh button it would help, my page type is worksheet so I only have Refresh and Clear Filter buttons in the ribbon

So my question is how can I refresh my data when the inbuilt refresh button is clicked or how can I hide the standard refresh button ?

Thanks in advance

Answers

  • geordiegeordie Member Posts: 655
    What about adding an hidden action managing reload of the data, having F5 as shortcut key?
  • SiStSiSt Member Posts: 46
    Another idea: The default Refresh button will trigger the OnAfterGetRecord / OnAfterGetCurrentRecord trigger. You can store the timestamp of the last refresh and check in OnAfterGetRecord if a certain time span, say one second, has passed. If it has passed you can refresh the data in the temporary table, store the new timestamp and call CurrPage.UPDATE.
  • SillysodSillysod Member Posts: 4
    SiSt wrote:
    Another idea: The default Refresh button will trigger the OnAfterGetRecord / OnAfterGetCurrentRecord trigger. You can store the timestamp of the last refresh and check in OnAfterGetRecord if a certain time span, say one second, has passed. If it has passed you can refresh the data in the temporary table, store the new timestamp and call CurrPage.UPDATE.

    I had considered adding a "hidden action " as suggested but I'm still left with a non functional refresh button
    Your suggestion to use the onAfterGetRecord looks like the best option, thanks

    Atleast I wasn't missing something blindingly obvious
  • awarnawarn Member Posts: 261
    I have come across this a few times - for a special page like this, I generally tell the users that since the data is just a snapshot of the data at the time the page was opened, they have to press the new 'Reload Data' function (which clears the screen and reloads data, from a function that is called both OnOpenPage and under the button), if they want the data refreshed.

    Promote that action and give it the Refresh image and they probably won't notice a difference. I wonder if you created this action and gave it the shortcut key of F5 if it would trigger when the user presses F5 to do a normal refresh?
Sign In or Register to comment.