A database table will have refresh time column set by user how to autorefresh it ?
Application Type
Reactive

Hi all,

I need to create a dummy table, which will have user id and autorefresh time interval set by user. Need to fetch that same interval to autorefresh. I have the javascript for autorefresh, need to make it dynamic so that the user value will get fetched in javascript and time will change accordingly. So, how shall I implement that?

probably through a var set by the user.  can you post your script for us to take a look at it?

Yes. 

setInterval(function(){

$action.RefreshSearchdata();

}, 3000);

here the refreshdearchdata action consists of table which has to be refreshed. 

Now, I need to fetch the interval set in a table which has user id and interval period in it. As the 3000 value is hardcoded so how can i make it dynamic that is in its place, i need the interval in the testtable.

You would pass a new parameter into the javascript block, new parameter in the block and then ref in the +script+, take a look at this links for more information

setInterval(function(){$action.RefreshSearchdata();}, + UserVariable  + );


https://www.outsystems.com/forums/discussion/36418/assign-outsystem-variable-to-js-variable/#

https://www.outsystems.com/forums/discussion/28846/how-to-pass-input-parameter-of-client-action-in-javascript/#



example included, sorry forgot to attach earlier

JSVars.oml

please let me know if that ^ helps

I understood, but actually i need to add that in my previous setinterval code. how to do it there?

Yes, thanks for that. But u have taken textvar a default value. But, if I have a table and I need a particular column value from a particular row to be assigned to this textvar variable. And then calling this variable from javascript input parameter, how to do that? 


Not clear if you mean Header of the table or a single cell in the table?

See attached for some more ideas, you can click on FirstName in the cell to get the value in that cell

or you can click on LastName Header..hope that helps.


Also, here is a link to some material 

https://www.outsystems.com/forums/discussion/38848/how-to-add-javascript-function-and-call-it-from-onclick-event-in-outsystem-mobile/#



JSVars.oml


If you mean that you'll have some sort of userPreference for this interval stored in the database, just use an aggregate to read it based on Current User and pass the result value from aggregate to the javascript widget.

Dorine

Hello

Has any of the answers provided you with a solution?  If so, please mark it so the community will know.

If not, please let us know.


v/r

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