HI
I have a requirement to refresh a page every 3 secs , can anyone help me with how can i achieve this in Outsystems 11
Thank you
Hello raju,
to refresh every 3 secs you can achieve this using javascript, Here I am adding a javascript function
function startIntervalRefresh() {
intervalT = setInterval(function () {
$('#" + RefreshTableAndChartButton.Id + "').click();
}, 3000);
}
function stopIntervalRefresh() {
clearInterval(intervalT);
For this you need to create a button: this button action contains reload page
this button action is getting triggered using the above javascript for every 3 secs
if you need more clarification please let me know, I am happy to help you :)
Hi Raju,
Another approach from what @Srinivas K Singadi suggested, if you would like to automatically refresh the page without involving any buttons, you can simply add the following Javascript code to the "OnRender" of your screen:
function refreshPage() {
location.reload();
setInterval(refreshPage, 3000);
Best regards,
Abed
Hello @Raju M
Would you like to refresh the whole page or just a perticular part of a screen, Would you like to refresh the screen to show updated data?
Because if you will refresh the whole page or reload the whole page that will be definatelly not a good user experience.
So if you can explain about the scenario and what you are trying to achive that would help to provide a better solution.
Thanks
Hi,
As an alternative to what was already mentioned here, you can use this component https://www.outsystems.com/forge/component-overview/10593/trigger-action.
This will allow you to easily refresh the screen every X seconds (value you can choose), or just call a screen action that can refresh any data source.
Hope this helps,
Pedro