Just starting with OS10.1

Doug Easterbrook doug at artsman.com
Fri Sep 11 09:48:10 EDT 2020


hi Martin.

we use ultra thin web pages (no the javascript client).      and I don’t know what your purpose is with a timer.  I don’t know if you are counting down or up — trying to give people a time-limited period in which ot enter data or be logged of or what have you.


we implemented timeouts in our software in HTML forms using a small amount of javascript embedded in the HTML page.,  if it helps, I included the gensis of it below ..  it just displays data into a field on the screen.

we also implement the function on the server that looks at the person’s connection for activity and kills them if there has been inactivity.  We have a 'last activity date’ and use a ddiff() with the current time on the client to kill the remote activity.



in the case of javascript client…. you might want to consider some feature that is a ddiff() of current time with a reference time .. assuming that the client can handle it.    and/or using a web-socket connection and running the timer on the server while pushing out some data if the timer expires.

If you have multiple clients connected, then you just need to have a list on the server of when people time out and run a timer every 5 seconds or so — to scan the list of potentially expiring clients.



they are just ideas.   I don’t know which sort of situation is applicable to you.

and I’m just guessing…. if the goal is time out — its probably better done on the server (which, after all is the paster process) with something running independently on the client to display the countdown (or up)


and it is to cause an action on the client, then a web socket push of the action by the server would likely be my approach.







 <script type="text/javascript">
   <!--
    $( document ).ready(function() {
        // Translate seconds integer into [minutes]:[seconds] text
		function textFromSeconds(timer) {
		    var minutes = parseInt(timer / 60, 10);
		    var seconds = parseInt(timer % 60, 10);

		    seconds = seconds < 10 ? "0" + seconds : seconds;
		    return minutes + ":" + seconds
		}

		// Start and run a timer for the reamining cart time
		function startTimer(duration, display) {
			var timer = duration;

			// Prime display quickly so it's not flashy
			var displayText = textFromSeconds(timer);
			display.each(function( index ) {
			  $( this ).text(displayText);
			});

			// Create timer function
			var runTimer = function() {
				if (!(timer > 0)) {
				   clearInterval(runTimer); 
				   return;
				}

		        var displayText = textFromSeconds(timer);
				display.each(function( index ) {
				  $( this ).text(displayText);
				});

				timer = timer - 1;
			}

			// Start up the repating timer.  NOTE: This must be 1000 as it matches with timer - 1
			setInterval(runTimer, 1000);
		}

		// Setup the countdown duration
		var durationSecs = 888.392871,
			display = $(".cart_countdown");

		if (true && durationSecs >= 0) {	
			startTimer(durationSecs, display);
		}
	});





Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On September 10, 2020, at 9:38 AM, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> Dear Kelly,
> I also have this same problem of Jim.
> I'm trying to display a timer/counter on a remote form using v10.1.If the form is clicked on, then the timer is reset.
> Do I display the timer in an entry field or in a timer control?
> and,
> Which superclass is being set to the object class?
> 
> Regards,Martin.
> 
> 
> 
> 
> 
>    On Thursday, September 10, 2020, 7:04:33 AM GMT+3, Kelly Burgess <kellyb at montana.com> wrote:  
> 
> Hi Jim,
> 
>> I’m not sure how to set up a Timer.
> 
> Create an Object class and set the superclass to the Timer external object.  Instantiate the object, assign the $useseconds and $timervalue properties, then call the $starttimer method to get it running.
> 
> Override the $timer method and put your action code there - that method will be called when the timer fires.
> 
> 
>> i’m not sure how to control eMails.
> 
> Look at this post for steps to use the Net Wizard to create some example email methods.
> 
>   https://lists.omnis-dev.com/pipermail/omnisdev-en/2020-June/043708.html
> 
> Also, via the Samples pane of the Hub in the Browser, you can look at the IMAP and POP3 OW3 worker object examples.
> 
> Kelly
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 




More information about the omnisdev-en mailing list