Being able to see when LzLoader is active is very useful when an application is under development. The following code displays “Loading” whenever the loader is active.
The display is text. The text has an ‘id’ of ‘loading’ and ‘visibility’ set to false.
<text id="loading" x="10" y="10" visible="false"
fontsize="12" fgcolor="white" fontstyle="bold">
Loading
</text>
The display is controlled in an idle handler. The visible property of the display is set depending on the number of open connections in the loader.
<handler name="onidle" reference="LzIdle">
<![CDATA[
loading.setVisible(LzLoadQueue.openConx > 0);
]]>
</handler>
The display shows you when the loader, and therefore the application, is busy. You can see how well load-spreading strategies like OpenLaszlo: background loading of images are working. It is a window into a part of your application that is normally hidden.

0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment