user972391
user972391

Reputation: 321

Multiple Select component in JSF/Primefaces

In a Primefaces picklist, you can select items from left to right (and vice versa). Is there any component that can be used to select multiple items of the same type? For example: on the left panel, there will be a list of items with a + icon at the end of each item. Clicking on the plus icon will update the right side panel with that item. Clicking on the plus again makes the item count on the right panel to two and so on (and a minus sign appears on the right panel to reduce the count if clicked). Is there any such inbuilt component in JSF? Or do I have to write my own component.

An example would be creating a camping list. On the left panel, we have Tents, Ropes, Beds etc - Each item can be selected multiple times, instead of just once like a picklist. Thank you !

Upvotes: 0

Views: 1485

Answers (2)

Badis
Badis

Reputation: 27

you can use the tree-drag&drop component of primefaces, here is the integration tutorial http://www.primefaces.org/showcase/ui/data/tree/dragdrop.xhtml

Upvotes: 1

Javier Haro
Javier Haro

Reputation: 1255

I'm afraid there is no such component, but the component you are describing doesn't seem very complex so you could write it in a composition page and include in your pages or use a template, as described here. A more complex alternative is to implement a custom component as described in the documentation. You should use two dataTables as basis. The election will depend on your specific project requesites.

Upvotes: 3

Related Questions