Defer the Rendering of Client Widgets

From Documentation
Revision as of 06:17, 16 July 2010 by Maya001122 (talk | contribs) (Created page with '{{ZKDevelopersGuidePageHeader}} [since 5.0.2] In additions to Performance Tip#Defer_the_Creation_of_Child_Components, you can defer the rendering of the widgets at the cli…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DocumentationZK Developer's ReferencePerformance TipsDefer the Rendering of Client Widgets
Defer the Rendering of Client Widgets


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


[since 5.0.2]

In additions to Performance Tip#Defer_the_Creation_of_Child_Components, you can defer the rendering of the widgets at the client by use of the renderdefer attribute. It is a technique to make a sophisticated page to appear earlier.

For example, we can defer the rendering of the inner window for 100 milliseconds as shown below

<window title="Render Defer" border="normal">
	The following is rendered after 100 milliseconds.
	<window title="inner" width="300px" height="200px" border="normal"
	renderdefer="100">
		Enter something <datebox onChange='i.value = self.value + ""'/>
		<separator/>
		<label id="i"/>
		<separator bar="true"/>
		<button label="say hi" onClick='alert("Hi")'/>
	</window>
</window>

Unlike the fulfill attribute, the components at the server and the widgets at the client are created no matter renderdefer is specified. It only defers and the rendering of the widgets into DOM elements.

Here is another example to use it with pure Java.

Tabpanel tp = new Tabpanel();
tp.setRenderdefer(0);

The render-defer technique is useful to improve the response time of showing a sophisticated page in a slow client. The total time required to render is not reduced (since all widgets have to render later), but it allow the page to show up sooner and it makes the user feel more responsive.



Last Update : 2010/07/16

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