cancel
Showing results for 
Search instead for 
Did you mean: 

Auto refresh for every 5 mins ...?

former_member203031
Contributor
0 Kudos

Hello Experts,

I am having small query...

In my application there are 3 radio buttons after selecting the particular radio button i am able to display the data in table.

But for every 5 mins i want to refresh the table automatically with out any user action.


I tried with model.refresh() but i am not sure how it is going to work.So expecting some best example..

Could you please guide me....

Thanks,

Deepak Raj.

Accepted Solutions (1)

Accepted Solutions (1)

SergioG_TX
Active Contributor
0 Kudos

Deepak,

there is a javascript function called setTimeout - may be an overkill to set this to refresh every 5 mins

Window setTimeout() Method

but i think that as the user navigates through your app, the model will get updated by itself when the page(ui view) is visited again.

alternatively, you could have the model to be refreshed when the user switches the radio button selection

former_member203031
Contributor
0 Kudos

Hi Serigo,

If user switches the radio button,then the the table will updated automatically.

But with out any user action also the model has to be refreshed.

For example lets say

user switches radiobutton 3 to radiobutton 1  then according to the selection values will be updated.

But if the didn't switched for 5-10 minutes then the selected radio button will be same then also with out any user action the values has to be updated.

I understood you comment about setTimeout()

I am not getting where to add this function.

selected:function(evt){

selected_but = "3";

var model = some values.

table.setModel(model);

//now i want to refresh this process..by using settimeout()

}

Thanks,

Deepak.

Former Member
0 Kudos

Hi,

You can try,


setInterval(function(){

     table.getModel().refresh(true);

},1000) //1000 for every 10 sec.

The setInterval() method repeats a given function at every given time-interval.

Best Regards,

Namita

former_member203031
Contributor
0 Kudos

Hi Serigi,

Thanks for the reply SetInterval() worked for me instead of setTimeout()

Thanks,

Deepak.

Answers (0)