Next / Previous / Contents / TCC Help System / NM Tech homepage

13.2. How to delay instantiation of an object

Unless you specify otherwise, your object will be “instantiated” (evaluated and turned into Web content) when your page is loaded.

Instead, you can delay instantiation of your object until later:

To delay instantiation of an object, use the declare="declare" attribute in the object element, and give it a unique identifier with the id attribute.

To refer to the object in a link:

  <a href="#idref">…</a>

where the idref is the id attribute of the previously declared object. For example:

  <object classid="mapview.py" id="mapper" declare="declare">
    <param name='start-quad' value='Water Canyon, NM'/>
  </object>
  ...
  <a href="#mapper">Map of Water Canyon</a>

In the above example, the page will have a link with the text “Map of Water Canyon”. The map viewer will not run until the user clicks on that link.

Suppose you want to pass an object as a parameter to another object. Use this param element in the second object:

  <param name='pname' value='#oid' valuetype='object'/>

where #oid is the id attribute of the object to be passed in.