Initialization
ITPElement defines the general initialization of an element in the tree. ITPRootElement defines the initialization of the tree as a whole. It is important to be aware of the steps that are part of this process:
- The HTML-page will contain one global instance itppage of the class ITPPage.
- On this instance, the JavaScript in the HTML page will call registerElement for each relevant element on the page, passing the corresponding information structure.
- The onload event of the page will call itppage.initialise.
- During initialization, an object will be constructed for each registered information structure. This is done by calling getITPElement on the global object itpelementfactory. This factory provides an abstraction layer to the actual construction of the objects and thus provides the basis for the extensibility model described below.
- As soon as all objects are constructed, the tree will be constructed from them by applying parent-child relations.
- After this, all objects will be initialized by calling their initialize methods. Initialization of an object may involve asynchrony. As part of the initialization of an object, its initScreenElements will be called. This is the point where the object may manipulate the contents of the page. The call should return a map of references to relevant screen elements, which can be used by other methods later on.
- As soon as all objects have reported back, synchronization will be invoked upon each element in the tree. This will induce the first traffic of messages through the tree.