Multiple select with checkbox from dropdown in PrimeFaces

不想你离开。 提交于 2020-01-02 20:19:13

问题


In PrimeFaces, can we choose multiple elements from drop down list with the help of checkbox? If my drop down is showing 5 elements, can I choose more than 1 element from the list?

I know in primeFaces we have <p:selectOneMenu> which will allow me to choose one element, but do we have something like <p:selectMultipleMenu>?

I was trying to find it out but not able to find something. Can you please let me know whether this is possible or not?


回答1:


There is <p:selectCheckboxMenu /> and it seems to provide what you need as you can see in showcase on: PrimeFacesShowCase-SelectCheckboxMenu




回答2:


It looks like the SelectManyMenu is exactly what you need.

http://www.primefaces.org/showcase/ui/input/manyMenu.xhtml

EDIT: miroslav_mijajlovic's answer may be better because you wanted a drop down.



来源:https://stackoverflow.com/questions/18895052/multiple-select-with-checkbox-from-dropdown-in-primefaces

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!