DecSoft App Builder

Timer description

The Timer is a non visual (don't appear in the screen at runtime) control that allows execute certain task at an established interval. This control offer to you the right properties and methods to start and stop the timer, change their interval, know if the timer is running and more.

There is a Timer sample app included with the installation of DecSoft App Builder. Take a look to see this control in action!

Timer at designtime

The Timer control put at your disposition the below designtime properties or variables. Designtime means here that these properties are only available in designtime and not in runtime.

Timer at runtime

The Timer control put at your disposition the below runtime properties or variables. You can set almost all these variables in designtime, and, they are also available to be use when the app is running. Note that we named here these variables in a capitalized way, because is like you can see it in the designtime control's inspector, however, at runtime we use the lower camel case way.

Timer methods

The Timer control put at your disposition the below methods. You can use these methods in runtime in order to perform various control related tasks.

Timer events

The Timer control put at your disposition the below events handlers:

Timer designtime properties

Timer Top property

Designtime. Integer variable. The Top property stores the top position of the control in pixels. This value is only take in consideration at designtime, since this is a non visual control, which do not appear in the screen at runtime.

Timer Left property

Designtime. Integer variable. The Left property stores the left position of the control in pixels. This value is only take in consideration at designtime, since this is a non visual control, which do not appear in the screen at runtime.

Timer Width property

Designtime. Integer variable. The Width property stores the width of the control in pixels. This value is only take in consideration at designtime, since this is a non visual control, which do not appear in the screen at runtime.

Timer Height property

Designtime. Integer variable. The Height property stores the height of the control in pixels. This value is only take in consideration at designtime, since this is a non visual control, which do not appear in the screen at runtime.

Timer Locked property

Designtime. Boolean variable. The Locked property determines if the control can be moved or resized in app view designer or not. This value is only take in consideration at designtime, since this is a non visual control, which do not appear in the screen at runtime.

Timer runtime properties

Timer Name property

Runtime. String variable. The Name control property stores the name of the Timer control as you set in designtime. The Name property value must be unique for the same app view, dialog or frame, that is, it's possible to have more than one "http1" in the app, if that controls resides in different app views, dialogs or frames. Note that you must consider this variable as read only: change the name of a control in runtime can cause unexpected results.

Timer Interval property

Runtime. Number variable. The Interval control property determines the number of milliseconds in which the control Tick event is fired when the Timer was started.

Timer Timer property

Runtime. Mixed variable. The Timer control stores the internal reference of the Timer or "null" if the timer is not running. This variable can be used to determine if the Timer is running or not.

Timer runtime methods

Timer start() method

Runtime method. You can use this Timer control method to start the Timer, so the Tick event is fired at the established Interval property.

Timer stop() method

Runtime method. You can use this Timer control method to stop a running Timer, so the Tick event is no more fired.

Timer setInterval() method

Runtime method. You can use this Timer control method to set the control Interval property. This method admits the below argument:

Name Type Description
interval Number The interval in milliseconds to be established in the Timer.

Timer events

Timer Tick event

The Tick event hander is fired, if the Timer has been started (is running), everytime the Timer reach the established Interval property, until the Timer was stoped. See also the available events variables.

Timer events variables

The below JavaScript variables are available in all the referred Timer control events handlers:

Name Type Description
event Mixed This variable is received in almost all control events. You can use this variable to stop the propagation of the event, to access the HTML element who fire the event and more.
self Object Stores the control object. This is a shortcut to the control variable, and it's available since we are talking about specific control events.
view Object

Stores the current app view or dialog. This variable allow us to access to that view or dialog properties and methods and also their controls properties and methods. For example, you can access to a control properties using the variable "view.yourControlName", suposing the control is named "yourControlName".

views Object Stores all the loaded app views. Note that loaded views mean that the app views has been previously show to the user. It's possible to access to the app view controls properties like "views.view1.yourControlName", suposing the view is named "view1" and the control is named "yourControlName". In the same way we can access to other controls of the view and to other loaded views and their controls.
frames Object Stores all the app frames. You can use this variable to access to all the app frames and their controls.
dialogs Object Stores all the app dialogs. You can use this variable to access to all the app dialogs and their controls.
app Object Stores all the app properties and methods. You can use this variable to access to all the app properties and app methods.