dcsimg
h:selectManyListbox issue
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   User_N
Posted On:   Wednesday, July 7, 2010 05:13 AM

Hi, I need to get a multiple select drop down component. How can this be acheieved? I tried I get the Objects displayed, but I need the name to be displayed instead. And when I try to submit, I get an error j_idt50:groups: Validation Error: Value is not valid though the values are displayed correct in the view source com.entity.Group@ffc9ca com.entity.Group@118f163 Here is my code @ManagedBean (name="groupController") @SessionScoped public class GroupController { public Se   More>>

Hi,

I need to get a multiple select drop down component.

How can this be acheieved?



I tried










I get the Objects displayed, but I need the name to be displayed instead.



And when I try to submit, I get an error
j_idt50:groups: Validation Error: Value is not valid



though the values are displayed correct in the view source







Here is my code



@ManagedBean (name="groupController")

@SessionScoped

public class GroupController {

public SelectItem[] getItemsAvailableSelectMany() {

return JsfUtil.getSelectItems(ejbFacade.findAll(), false);

}

}



public class GroupConverter implements Converter {

public String getAsString(FacesContext facesContext, UIComponent component, Object object) {

if (object instanceof Group) {

Group o = (Group) object;

return new String(new Integer(o.getGroupId()).toString());

}

}

}

   <<Less
About | Sitemap | Contact