zk combobox databinding
The zk code below only shows on item...
I need it to show all elements in tmp. any idea? thanks<zscript>
<![CDATA[
List tmp=Arrays.asList(new String[]{"a","b","c"});
]]>
</zscript>
<combobox id="mycb&qu开发者_如何转开发ot; model="@{tmp}">
<comboitem self="@{each=row}" label="xxx" value="yyy">
</comboitem>
</combobox>
You need to initialize the databinder in your ZUL file. In addition there is no need to wrap your array as a List (you can if you want to). The following code works:
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<zk>
<zscript>
<![CDATA[
String[] data = new String[]{"a","b","c"};
]]>
</zscript>
<combobox id="list" width="200px" model="@{data}"/>
</zk>
精彩评论