111
Views
4
Comments
Solved
Reload/Refresh page every three secs
Question

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

2022-02-25 19-42-59
Srinivas K Singadi
Solution

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 :) 

2024-01-04 15-15-51
Abed Al Banna

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

2023-10-21 19-42-11
Tousif Khan
Champion

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

2024-11-20 08-28-20
Pedro Marques

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.