<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?> <zk> <window> <zscript><![CDATA[ class Data { private List list; private String selItem; public Data() { list = new ArrayList(); list.add("Item 1"); list.add("Item 2"); list.add("Item 3"); } public List getList() { return list; } public String getSelItem() { return selItem; } public void setSelItem(String selItem) { this.selItem = selItem; } } Data data = new Data(); ]]></zscript> <listbox width="150px" model="@{data.list}" selectedItem="@{data.selItem}"> <listitem label="@{each}"/> </listbox> <button label="1. set selected item"> <attribute name="onClick"><![CDATA[ data.setSelItem("Item 1"); binder.loadAll(); ]]></attribute> </button> <button label="2. clear selected item"> <attribute name="onClick"><![CDATA[ data.setSelItem(null); binder.loadAll(); ]]></attribute> </button> </window> </zk>