在zk中获取值复选框

时间:2013-08-14 04:24:31

标签: zk zk-grid

我有一个带有列表复选框的网格

    <div height="200px">
<grid id ="actListBox" model="@bind(vm.actions)" >
<template name="model">
<row style=" width:200px !important; ">
    <cell rowspan="5" align="left" >
      <checkbox style="height: 70px; width:1000px; overflow: auto;   margin-left:10px;" 
      label="${each.action_name}" id ="${each.actionid}" value ="${each.actionid}"  />
     </cell>
</row>
</template>
</grid>
<span>
<checkbox label="Check all" value ="checkall" id="chkAll"/>
</span>
</div>

现在我想获得复选框的所有值,但无论如何我都找不到 请帮我 谢谢所有

1 个答案:

答案 0 :(得分:1)

你可以在作曲家中通过迭代动作来检查ID:

@Command
public void checkedIds(final Event e){
    final StringBuilder builder = new StringBuilder("Checked Ids: ");
    for (final Action action : actions) {
        if (action.getChecked()) {
            builder.append(action.getId()).append(' ');
        }
    }
    Messagebox.show(builder.toString());      
}

我更新了ZK fiddle