0

私は、HtmlSelectManyCheckbox によってバインドされている以下のような 1 つのコンポーネントを持っています。

<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>

バッキングビーンHoliday_Declarationを使用して、チェックされたチェックボックスの総数とその値が必要です。

助けてくれてありがとう...

4

1 に答える 1

1

Have following field in your managed bean

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

Cover your component in an h:form and on submit access this list from some action

于 2011-04-27T12:04:35.780 に答える