开发者

<h:selectManyCheckbox> binding solution

开发者 https://www.devze.com 2023-03-01 04:50 出处:网络
i have one component as below,which is binded by HtmlSelectManyCheckbox, <h:selectManyCheckbox id=\"chk_weekdays\"

i have one component as below,which is binded by 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>

and i want total number of checked checkboxes and their values using backing bean Holiday_Declaration.

Thank开发者_运维技巧s for any help...


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

0

精彩评论

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