The org.zkoss.zk.ui.sys.PropertiesRenderer interface

From Documentation

DocumentationZK Configuration Referencezk.xmlThe listener ElementThe org.zkoss.zk.ui.sys.PropertiesRenderer interface
The org.zkoss.zk.ui.sys.PropertiesRenderer interface



A listener could implement PropertiesRenderer to generate application-specific client-side properties of a component.

Once registered, PropertiesRenderer.renderProperties(Component, ContentRenderer) will be invoked each time a component has rendered its client-side properties. The application-specific properties generated by this method will be sent with the default properties generated by the client. If there is a property with the same name, the default one will be evaluated first, and the the application-specific one.

For example, assume you have an implementation called foo.MyRenderer, then you could specify it in WEB-INF/zk.xml

<!-- in WEB-INF/zk.xml -->

And, assume you'd like to generate an extra property if the component is a datebox, you could do as follows.

package foo;
import org.zkoss.zk.ui.sys.*;
import org.zkoss.zk.ui.Component;
import org.zkoss.zul.*;
public class MyRenderer implements PropertiesRenderer {
    public void render(Component comp, ContentRenderer renderer)
    throws {
        if (comp instanceof Datebox) {
            renderer.render("myProp", myValue);

Instantiation: For better performance, a single instance of the given class is instantiated when registered. It is then shared in the whole application. Thus, the implementation must be thread safe.

Version History

Last Update : 2022/01/19

Version Date Content
5.0.7 April 2011 PropertiesRenderer was introduced.

Last Update : 2022/01/19

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