Defer the Rendering of Client Widgets"
m |
|||
Line 1: | Line 1: | ||
− | {{ | + | {{ZKDevelopersReferencePageHeader}} |
[since 5.0.2] | [since 5.0.2] | ||
Line 7: | Line 7: | ||
For example, we can defer the rendering of the inner window for 100 milliseconds as shown below | For example, we can defer the rendering of the inner window for 100 milliseconds as shown below | ||
− | < | + | <syntax lang="xml"> |
<window title="Render Defer" border="normal"> | <window title="Render Defer" border="normal"> | ||
The following is rendered after 100 milliseconds. | The following is rendered after 100 milliseconds. | ||
Line 19: | Line 19: | ||
</window> | </window> | ||
</window> | </window> | ||
− | </ | + | </syntax> |
Unlike the <code>fulfill</code> attribute, the components at the server and the widgets at the client are created no matter <code>renderdefer</code> is specified. It only defers and the rendering of the widgets into DOM elements. | Unlike the <code>fulfill</code> attribute, the components at the server and the widgets at the client are created no matter <code>renderdefer</code> is specified. It only defers and the rendering of the widgets into DOM elements. | ||
Line 25: | Line 25: | ||
Here is another example to use it with pure Java. | Here is another example to use it with pure Java. | ||
− | < | + | <syntax lang="java"> |
Tabpanel tp = new Tabpanel(); | Tabpanel tp = new Tabpanel(); | ||
tp.setRenderdefer(0); | tp.setRenderdefer(0); | ||
− | </ | + | </syntax> |
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. | 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. | ||
− | {{ | + | =Version History= |
+ | |||
+ | {| border='1px' | width="100%" | ||
+ | ! Version !! Date !! Content | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | {{ ZKDevelopersReferencePageFooter}} |
Revision as of 11:44, 17 September 2010
[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
<syntax lang="xml"> <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> </syntax>
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.
<syntax lang="java"> Tabpanel tp = new Tabpanel(); tp.setRenderdefer(0); </syntax>
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.
Version History
Version | Date | Content |
---|---|---|