Combobox Template"
From Documentation
m ((via JWB)) |
m ((via JWB)) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
Similar to [[ZK Developer's Reference/MVC/View/Template/Listbox Template|Listbox]], you can render a combobox with a template: | Similar to [[ZK Developer's Reference/MVC/View/Template/Listbox Template|Listbox]], you can render a combobox with a template: | ||
− | <source lang="xml" | + | <source lang="xml" highlight="2,3"> |
<combobox model="${infos}"> | <combobox model="${infos}"> | ||
<template name="model"> | <template name="model"> | ||
Line 11: | Line 11: | ||
</source> | </source> | ||
− | where we assume there is a list model (<javadoc>org.zkoss.zul.ListModel</javadoc>) called < | + | where we assume there is a list model (<javadoc>org.zkoss.zul.ListModel</javadoc>) called <code>infos</code> such as: |
<source lang="java"> | <source lang="java"> | ||
Line 23: | Line 23: | ||
=Version History= | =Version History= | ||
− | + | ||
{| class='wikitable' | width="100%" | {| class='wikitable' | width="100%" | ||
! Version !! Date !! Content | ! Version !! Date !! Content |
Latest revision as of 07:34, 8 July 2022
Similar to Listbox, you can render a combobox with a template:
<combobox model="${infos}">
<template name="model">
<comboitem label="${each[0]}: ${each[1]}"/>
</template>
</combobox>
where we assume there is a list model (ListModel) called infos
such as:
ListModel infos = new ListModelArray(
new String[][] {
{"Apple", "10kg"},
{"Orange", "20kg"},
{"Mango", "12kg"}
});
Version History
Version | Date | Content |
---|---|---|
6.0.0 | July 2011 | The template feature was introduced. |