开发者

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=&quot;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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜