Renderer"

From Documentation
(Created page with "{{ZKDevelopersReferencePageHeader}} A renderer is a Java class that is used to render the items specified in a data model<ref>If you prefer to define the rendering of each item ...")
 
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
  
A renderer is a Java class that is used to render the items specified in a data model<ref>If you prefer to define the rendering of each item in the ZUML document, you could use [[ZK Developer's Reference/MVC/View/Template|templates]] instead.</ref>. The implementation of a renderer depends on the component. For example, the display of <javadoc>org.zkoss.zul.Listbox</javadoc> can be customized by an implementation of <javadoc type="interface">org.zkoss.zul.ListitemRenderer</javadoc>, and <javadoc>org.zkoss.zul.Grid</javadoc> by <javadoc type="interface">org.zkoss.zul.RowRenderer</javadoc><ref>The same model usually can be shared by components having the same ''logic model''. For example, <javadoc type="interface">org.zkoss.zul.ListMode</javadoc> can be used in both <javadoc>org.zkoss.zul.Grid</javadoc> and <javadoc>org.zkoss.zul.Listbox</javadoc>. However, a renderer is usually specific to a particular component.</ref>.
+
A '''renderer''' is a Java class that produces child items based on a data model. It renders your data into View. There are 2 kinds of renderers:
 +
 
 +
#. Render child components: like <javadoc type="interface">org.zkoss.zul.ListitemRenderer</javadoc>, <javadoc type="interface">org.zkoss.zul.RowRenderer</javadoc>
 +
#. Render HTML snippets: <javadoc type="interface">org.zkoss.zul.ListitemRenderer</javadoc>.
 +
 
 +
The implementation of a renderer depends on the component. For example, the display of <javadoc>org.zkoss.zul.Listbox</javadoc> can be customized by an implementation of <javadoc type="interface">org.zkoss.zul.ListitemRenderer</javadoc>, and <javadoc>org.zkoss.zul.Grid</javadoc> by <javadoc type="interface">org.zkoss.zul.RowRenderer</javadoc>.
 +
 
 +
If you prefer to define the rendering of each item in the ZUML document, you can use [[ZK Developer's Reference/MVC/View/Template|templates]] instead.
  
<blockquote>
 
----
 
<references/>
 
</blockquote>
 
  
 
{{ZKDevelopersReferenceHeadingToc}}
 
{{ZKDevelopersReferenceHeadingToc}}
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Revision as of 04:36, 8 May 2023

A renderer is a Java class that produces child items based on a data model. It renders your data into View. There are 2 kinds of renderers:

  1. . Render child components: like ListitemRenderer, RowRenderer
  2. . Render HTML snippets: ListitemRenderer.

The implementation of a renderer depends on the component. For example, the display of Listbox can be customized by an implementation of ListitemRenderer, and Grid by RowRenderer.

If you prefer to define the rendering of each item in the ZUML document, you can use templates instead.




Last Update : 2023/05/08

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