Molds"

From Documentation
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
  
A component could have multiple different visual appearances. Each appearance is called a mold. A mold is basically a combination of a DOM structure plus CSS. That is, it is the visual representation of a component. Developers could dynamically change the mold by use of <javadoc method="setMold(java.lang.String)" type="interface">org.zkoss.zk.ui.Component</javadoc>.
+
A component could have multiple different visual appearances. Each appearance is called a '''mold'''. A mold is basically a combination of a DOM structure plus CSS. That is, it is the visual representation of a component. Developers could dynamically change the mold by use of <javadoc method="setMold(java.lang.String)" type="interface">org.zkoss.zk.ui.Component</javadoc>.
  
 
All components support at least a mold called <tt>default</tt>, which is the default value. Some components might have support two or more molds. For example, tabbox supports both <tt>default</tt> and <tt>accordion</tt> molds.
 
All components support at least a mold called <tt>default</tt>, which is the default value. Some components might have support two or more molds. For example, tabbox supports both <tt>default</tt> and <tt>accordion</tt> molds.
  
 
If <tt>tabbox</tt>'s <tt>mold</tt> is not set, it uses the default mold.
 
If <tt>tabbox</tt>'s <tt>mold</tt> is not set, it uses the default mold.
<source lang="xml" >
+
<source lang="xml" high='1'>
 
<tabbox>
 
<tabbox>
 
<tabs>
 
<tabs>
Line 12: Line 12:
 
<tab label="Second tab" />
 
<tab label="Second tab" />
 
</tabs>
 
</tabs>
<tabpanels>
+
...
<tabpanel>The first panel.</tabpanel>
 
<tabpanel>The second panel.</tabpanel>
 
</tabpanels>
 
 
</tabbox>
 
</tabbox>
 
</source>
 
</source>
  
 
And you could set <tt>tabbox</tt>'s mold to "accordion" to change the look.
 
And you could set <tt>tabbox</tt>'s mold to "accordion" to change the look.
<source lang="xml" >
+
<source lang="xml" high='1'>
 
<tabbox mold="accordion">
 
<tabbox mold="accordion">
 
<tabs>
 
<tabs>
Line 26: Line 23:
 
<tab label="Second tab" />
 
<tab label="Second tab" />
 
</tabs>
 
</tabs>
<tabpanels>
+
...
<tabpanel>The first panel.</tabpanel>
 
<tabpanel>The second panel.</tabpanel>
 
</tabpanels>
 
 
</tabbox>
 
</tabbox>
 
</source>
 
</source>
  
For more information about component's molds, please refer to [[ZK Component Reference]].
+
To know which mold a component supports, please refer to [[ZK Component Reference]].
 +
 
 
=Version History=
 
=Version History=
 
{{LastUpdated}}
 
{{LastUpdated}}

Revision as of 02:54, 29 September 2020

A component could have multiple different visual appearances. Each appearance is called a mold. A mold is basically a combination of a DOM structure plus CSS. That is, it is the visual representation of a component. Developers could dynamically change the mold by use of Component.setMold(String).

All components support at least 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 uses the default mold.

<tabbox>
	<tabs>
		<tab label="First tab" />
		<tab label="Second tab" />
	</tabs>
	...
</tabbox>

And you could set tabbox's mold to "accordion" to change the look.

<tabbox mold="accordion">
	<tabs>
		<tab label="First tab" />
		<tab label="Second tab" />
	</tabs>
	...
</tabbox>

To know which mold a component supports, please refer to ZK Component Reference.

Version History

Last Update : 2020/09/29


Version Date Content
     



Last Update : 2020/09/29

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