0

我有一个组件如下,它由 HtmlSelectManyCheckbox 绑定,

<h:selectManyCheckbox id="chk_weekdays"
    onclick="restrictCheck(this)"
    binding="#{Holiday_Declaration.chk_weekedays}"
    >
           <f:selectItem id="chk_1" itemLabel="Monday"  itemValue="1" />
            <f:selectItem id="chk_2" itemLabel="Tuesday"  itemValue="2" />
            <f:selectItem id="chk_3" itemLabel="Wednesday"  itemValue="3" />
            <f:selectItem id="chk_4" itemLabel="Thursday"  itemValue="4" />
             <f:selectItem id="chk_5" itemLabel="Friday"  itemValue="5" />
             <f:selectItem id="chk_6" itemLabel="Saturday"  itemValue="6" />
             <f:selectItem id="chk_0" itemLabel="Sunday"  itemValue="0" /></h:selectManyCheckbox>

我想要使​​用支持 bean Holiday_Declaration 的选中复选框的总数及其值。

谢谢你的帮助...

4

1 回答 1

1

在您的托管 bean 中有以下字段

 private List<String> chk_weekedays;
 // getters/setters

覆盖您的组件,h:form并在提交时通过某些操作访问此列表

于 2011-04-27T12:04:35.780 回答