I have been playing around with the initstage property on views, in order to enhance performance (references below). The initstage property tells OpenLaszlo when to complete initialisation after the object has been instantiated.
The Manual
<strong>initstage</strong>
The execution of a node's init method and sending of the oninit event is under the control of its initstage attribute, as follows:
<table>
<tr>
<td vAlign="top">immediate</td>
<td>The init method is called immediately as the last stage of instantiation.</td>
</tr>
<tr>
<td vAlign="top">early</td>
<td>The init method is called immediately after the view and its children have been instantiated.</td>
</tr>
<tr>
<td vAlign="top">normal</td>
<td>The init method is called when the parent is initialized.</td>
</tr>
<tr>
<td vAlign="top">late</td>
<td>The init method is called during idle time. To check whether init has been called, check the isinited property. Force calling init using the completeInstantiation method.</td>
</tr>
<tr>
<td vAlign="top">defer</td>
<td>The init method will not be called unless explicitly requested by the completeInstantiation method.</td>
</tr>
</table>
My Experience
For many of my views I was using “late”, but I decided to change it to “defer” to squeeze out some more performance. All views would only be instantiated on demand.
However the result was not what I expected. The performance was actually worse, because the delay when views became visible was even more noticeable than before. The requirement to initialise the views just-in-time lead to a noticeable lag in the UI.
It seems the “late” initialisation, using idle time, was quite efficient. So now I have changed everything back.
References
OpenLaszlo: optimising for a large number of views
OpenLaszlo: background loading of images
good site napgxj