Mold"

From Documentation
m (Created page with '{{ZKDevelopersGuidePageHeader}} A component could have different appearance even at the same page. The concept is called mold (aka., template). Developers could dynamically chan…')
 
m
Line 30: Line 30:
 
</tabbox>
 
</tabbox>
 
</source>
 
</source>
 
*[[How do we know what molds does a component has?]]
 
*[[How to implement your own mold?]]
 
  
 
{{ ZKDevelopersGuidePageFooter}}
 
{{ ZKDevelopersGuidePageFooter}}

Revision as of 12:05, 27 December 2010

Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


A component could have different appearance even at the same page. The concept is called mold (aka., template). Developers could dynamically change the mold by use of the setMold method in the Component interface. All components support a mold called default, which is the default value. Some components might have support two or more molds For example, tabbox supports both default and accordion molds.

If tabbox's mold is not set, it use default mold.

<tabbox>
	<tabs>
		<tab label="First tab" />
		<tab label="Second tab" />
	</tabs>
	<tabpanels>
		<tabpanel>The first panel.</tabpanel>
		<tabpanel>The second panel.</tabpanel>
	</tabpanels>
</tabbox>

Set tabbox's mold to "accordion",

<tabbox mold="accordion">
	<tabs>
		<tab label="First tab" />
		<tab label="Second tab" />
	</tabs>
	<tabpanels>
		<tabpanel>The first panel.</tabpanel>
		<tabpanel>The second panel.</tabpanel>
	</tabpanels>
</tabbox>



Last Update : 2010/12/27

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