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