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 | + | 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. | ||
− | |||
− | |||
− | |||
− | |||
{{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:
- . Render child components: like ListitemRenderer, RowRenderer
- . 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.