Defer the Creation of Child Components

From Documentation
Revision as of 06:16, 16 July 2010 by Maya001122 (talk | contribs) (Created page with '{{ZKDevelopersGuidePageHeader}} For sophisticated pages, the performance can be improved if we defer the creation of child components until they are becoming visible. The simple…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DocumentationZK Developer's ReferencePerformance TipsDefer the Creation of Child Components
Defer the Creation of Child Components


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


For sophisticated pages, the performance can be improved if we defer the creation of child components until they are becoming visible. The simplest way to do it is by use of the fulfill attribute. In the following example, the children of the second tab panel are created only if it becomes visible. Refer to the Load on Demand section in the ZK User Interface Markup Language chapter.

<tabbox>
    <tabs>
        <tab label="Preload" selected="true"/>
        <tab id="tab2" label="OnDemand"/>
    </tabs>
    <tabpanels>
        <tabpanel>
			This panel is pre-loaded since no fulfill specified
        </tabpanel>
        <tabpanel fulfill="tab2.onSelect">
			This panel is loaded only tab2 receives the onSelect event
        </tabpanel>
    </tabpanels>
</tabbox>



Last Update : 2010/07/16

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.