Chosenbox Template"
From Documentation
m ((via JWB)) |
m ((via JWB)) |
||
Line 3: | Line 3: | ||
Similar to [[ZK Developer's Reference/MVC/View/Template/Listbox Template|Listbox]], you can render a chosenbox with a template. However, notice that, unlike other components, chosenbox doesn't allow any child component, so you have to render each item as a string. For example, | Similar to [[ZK Developer's Reference/MVC/View/Template/Listbox Template|Listbox]], you can render a chosenbox with a template. However, notice that, unlike other components, chosenbox doesn't allow any child component, so you have to render each item as a string. For example, | ||
− | <source lang="xml" | + | <source lang="xml" highlight="2,3"> |
<chosenbox model="${users}" onSelect='alert(model.get(event.getData()));'> | <chosenbox model="${users}" onSelect='alert(model.get(event.getData()));'> | ||
<template name="model"> | <template name="model"> |
Revision as of 06:00, 12 January 2022
Similar to Listbox, you can render a chosenbox with a template. However, notice that, unlike other components, chosenbox doesn't allow any child component, so you have to render each item as a string. For example,
<chosenbox model="${users}" onSelect='alert(model.get(event.getData()));'>
<template name="model">
Name is ${each}
</template>
</chosenbox>
where we assume there is a list model (ListModel) called users such as:
ListModelList model = new ListModelList(new String[] { "Tony", "Ryan", "Jumper", "Wing", "Sam" });
Version History
Version | Date | Content |
---|---|---|
6.0.1 | April 2012 | The chosenbox component was introduced. |
6.0.0 | July 2011 | The template feature was introduced. |