Having a checkboxes inside Listbox of jsf or primefaces

Hi what i have currently done is that i have make a list box inside which im selecting user with checkboxes it's all done through html and javascript and css now requirement is that i need the same functionality with jsf or primefaces please tell me the way how to perform this or is their any already implemented functionality in jsf or prime faces

something like that i want ,that under drop down list box multiple checkboxes are there

   <h:selectManyListbox value="#{user.favFood1}">
            <h:selectManyCheckbox id="subscriptions" layout="pageDirection">
                <f:selectItem id="item1" itemLabel="News" itemValue="1" />
                <f:selectItem id="item2" itemLabel="Sports" itemValue="2" />
                <f:selectItem id="item3" itemLabel="Music" itemValue="3" />
                <f:selectItem id="item4" itemLabel="Java" itemValue="4" />
                <f:selectItem id="item5" itemLabel="Web" itemValue="5" />
            </h:selectManyCheckbox>
    </h:selectManyListbox>

you can use like this

<p:selectCheckboxMenu value="#{user.favFood1}"> <f:selectItem id="item1" itemLabel="News" itemValue="1" /> <f:selectItem id="item2" itemLabel="Sports" itemValue="2" /> <f:selectItem id="item3" itemLabel="Music" itemValue="3" /> <f:selectItem id="item4" itemLabel="Java" itemValue="4" /> <f:selectItem id="item5" itemLabel="Web" itemValue="5" /> </p:selectCheckboxMenu>

It will create a checkbox inside the dropdown.

链接地址: http://www.djcxy.com/p/68546.html

上一篇: 布尔复选框,设置文本字段的值

下一篇: 在jsf或primefaces的Listbox中有一个复选框