<zk>
<zscript><![CDATA[
public class Item {
private String name;
public Item(String name) {
super();
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Item other = (Item) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
}
int i = 0;
List list = Arrays.asList(new Item[]{
new Item("AA"), new Item("BB"), new Item("CC"), new Item("DD"), new Item("EE")});
ListModelList model = new ListModelList(list);
]]></zscript>
<chosenbox id="box" width="200px" model="${model}" >
<template name="model">
<label value="${each.name}"/>
</template>
</chosenbox>
<button label="model replace">
<attribute name="onClick"><![CDATA[
alert(box.getSelectedObjects());
]]></attribute>
</button>
</zk>