Functions and Method Prototypes

During document startup, the Dashboard Studio template framework causes the OnClick() event of every command button on a FrameType 1020. Each event is preconfigured with JavaScript that declares or instantiates functions that can be called by the clients of the component. This pattern of JavaScript declares the function and instantiates it as part of the Interactive Reporting Studio dynamic runtime object model.

var trl=0
var thisSection=this.Parent
Qiq_trace("In " + txlMe.Text+"."+ this.Name,trl,thisSection)
var cnAD=ActiveDocument
var cnClass=cnAD.Sections[txlMe.Text]
var Qiq_clsGlobals=cnAD.Qiq_clsGlobals


function Qiq_service(in_clsCaller){
//=============================
  Qiq_trace("In "+txlMe.Text+".Qiq_service()",trl+1,thisSection)
  Qiq_trace("Out "+txlMe.Text+".Qiq_service()",trl+1,thisSection)
}
cnClass.Qiq_service=Qiq_service


Qiq_trace("Out " + txlMe.Text+"."+ this.Name,trl,thisSection)

A line by line explanation follows:

// set the base trace level
// create a reference to the section on which this control is found
// trace the start of the event that instantiates the functions
// create a reference to the ActiveDocument
// create a reference to the Class that  hold our functions
// create a reference to the Globals class


// declare the function header
//=============================
  // trace the start of the function call
  // trace the end of the function call
// terminate the function
// create a property in cnClass that references the function


// trace the end of the event that has instantiated the functions