Class ComponentRedraws

  extended by org.zkoss.zk.ui.sys.ComponentRedraws

public class ComponentRedraws
extends java.lang.Object

Utilities to implement ComponentCtrl.redraw( Like HtmlPageRenders.getRenderContext(org.zkoss.zk.ui.Execution), they are used to simplify the implementation of the component rendering. However, there are some differences:


Constructor Summary
Method Summary
static java.lang.String afterRedraw()
          Called after finishing the redrawing.
static int beforeRedraw(boolean includingPage)
          Called before staring the redrawing.
static getScriptBuffer()
          Returns the string buffer for the snippet that shall be generated after rendering the components.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ComponentRedraws()
Method Detail


public static final int beforeRedraw(boolean includingPage)
Called before staring the redrawing. AbstractComponent.redraw( calls this method before calling AbstractComponent.renderProperties(org.zkoss.zk.ui.sys.ContentRenderer) and AbstractComponent.redrawChildren(

If this method is called, afterRedraw() must be called in the finally clause:

try {
} finally {

includingPage - whether this invocation is caused to include a new page. Unless for implementing an include component, this parameter shall be false.
the order of redrawing of the component being redrawn among its siblings. If 0, it means it is the first sibling. If 1, it is the 2nd sibling. If -1, it means it is the top-level component in this redrawing. In other words, it is the component that ComponentCtrl.redraw( is called against.


public static final getScriptBuffer()
Returns the string buffer for the snippet that shall be generated after rendering the components. The content being added to the returned string buffer will be returned by afterRedraw() if it is called against the top-level component.


public static final java.lang.String afterRedraw()
Called after finishing the redrawing. It must be called in the finally clause if beforeRedraw(boolean) is called.

the snippet that shall be written to the HTML output. For HTML components, it is actually JavaScript snippet. To inject the snippet, just invoke getScriptBuffer() and append the snippet into the returned string buffer.
Notice that it always returns an empty string if it is not the top level.

Copyright © 2005-2011 Potix Corporation. All Rights Reserved. Logo