NetTalk Central

Author Topic: how to add timer to form  (Read 2906 times)

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
how to add timer to form
« on: February 04, 2015, 02:21:25 PM »
NT 8.31

I have a form that I want to have a timer on and then be able to run code in the equivalent of Event:Timer. Is this doable? And if so, could someone point me in the right direction?

Thanks,

Chuck

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: how to add timer to form
« Reply #1 on: February 08, 2015, 10:24:15 PM »
Hi Chuck,

There are a lot of possible nuances to your question, but I'm going to make some assumptions - if I get them wrong then please let me know and we can adjust as necessary.

I'm assuming that you are displaying data on a form - and this field might change on the back-end, and you want the change to be reflected on the form. (a bit lower down I'll explain why this is potentially a bad idea to begin with, but let's assume for the moment that you're happy with all that.)

a) Create a NetWebSource procedure -
In this procedure set a timer, and create the HTML that you want to display.

b) On the form create a field, of type "Procedure" and add the NetWebSource here.

The timer will trigger, which in turn will call the NetWebSource, which in turn will update itself on the page.

Of course the standard caveats for times apply - they make a request to the server on every timer event, regardless of whether someone is watching the page or not. 100 people on this page means 100 times, means 100 requests for every interval. This can put your server under a lot of load if you're not very careful.

cheers
Bruce