How to populate the target in Primefaces picklist? I googled it but i didn't find any example related to this which help my requirement.
I have list of players which is already selected and unassigned. I want to use picklist. Source display the unassigned and target will show the selected one. Admin can make selected player unassigned (target->source) and vice versa.
I think the showcase which zargarf mentioned is quite enough to populate the target. If you look over the constructor of the bean, there are sources populated. In the same way you can populate the targets.
Currently in the constructor is :
//Players
List<Player> source = new ArrayList<Player>();
List<Player> target = new ArrayList<Player>();
source.add(new Player("Messi", 10, "messi.jpg"));
source.add(new Player("Iniesta", 8, "iniesta.jpg"));
source.add(new Player("Villa", 7, "villa.jpg"));
source.add(new Player("Alves", 2, "alves.jpg"));
source.add(new Player("Xavi", 6, "xavi.jpg"));
source.add(new Player("Puyol", 5, "puyol.jpg"));
players = new DualListModel<Player>(source, target);
Do in the same way with the target. target.add(...)
Hope this helps.