Tabbox Renderer"

From Documentation
m (replace tt with code (via JWB))
m (remove empty version history (via JWB))
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
  {{ZK EE}}
 
  {{ZK EE}}
[Since 7.0.0]
+
{{versionSince|7.0.0}}
 
Here we describe how to implement a custom renderer for a tabbox (<javadoc type="interface">org.zkoss.zul.TabboxRenderer</javadoc>). For the concepts about component, model and renderer, please refer to [[ZK_Developer's_Reference/MVC/Model/List_Model#Model-driven_Display|the Model-driven Display section]].
 
Here we describe how to implement a custom renderer for a tabbox (<javadoc type="interface">org.zkoss.zul.TabboxRenderer</javadoc>). For the concepts about component, model and renderer, please refer to [[ZK_Developer's_Reference/MVC/Model/List_Model#Model-driven_Display|the Model-driven Display section]].
  
Line 25: Line 25:
 
</blockquote>
 
</blockquote>
  
=Version History=
+
 
{{LastUpdated}}
 
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
|-
 
| 7.0.0
 
| November 2013
 
| [http://tracker.zkoss.org/browse/ZK-2002 Tabbox support ListModel]
 
|}
 
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Latest revision as of 04:38, 5 February 2024

  • Available for ZK:
  • http://www.zkoss.org/product/zkhttp://www.zkoss.org/whyzk/zkeeVersion ee.png

Since 7.0.0 Here we describe how to implement a custom renderer for a tabbox (TabboxRenderer). For the concepts about component, model and renderer, please refer to the Model-driven Display section.

When a tabbox (Tabbox) is assigned with a model, a default renderer is assigned too. The default renderer will assume that each tab has only one tabpanel, and it converts the data into a string directly[1]. If you want to display a rich tabpanel or retrieve a particular field of the data, you have to implement TabboxRenderer to handle the rendering.

For example,

public class MyRenderer implements TabboxRenderer{
	public void renderTab(Tab tab, Object data, int index) {
		tab.setLabel("New -- " + data);
	}
	public void renderTabpanel(Tabpanel tabpanel, Object data, int index) {
		tabpanel.appendChild(new Label("New -- " + data));
	}
}

  1. If the tabbox is assigned a template called model:tab and model:tabpanel, then the template will be used to render the tabbox. For more information, please refer to the Tabbox Template section.




Last Update : 2024/02/05

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