Passing SelectItem instances as argument to a method
I am wondering whether its possible to pass instances of SelectItem as argument to a method. Here is the situation
private List selectedUserRoles = new ArrayList<SelectItem>();
I expect setSelectedUserRoles method to recieve instances of SelectItem with Id and Value as arguments. For example how do i pass the value "new SelectItem("10","Admin")" etc to the below method :
public void setSelectedUserRoles(List selectedUserRoles) {
this.selectedUserRoles = selectedUserRoles;
System.out.println("Setter this.selectedUserRoles "+ this.selectedUserRoles);
}
The above method recieves only Ids whereas i need both Ids and Values. Here is the snippet from JSP page
<h:selectManyListbox id="userRoles" value="#{ test.selectedUserRoles}">
<f:selectItemsvalue="#{test.userRoles}" />
</h:selectManyListbox>
Any pointers/suggestions will be highly appreciated
Regards
Bansi

