my JSF page
BalusC (again) nailed this one for me. I had the same problem and as BalusC pointed out earlier my converter's getAsString() method returned my object's "firstname" property.
@Override public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value == null || value.equals("")) {
return "";
}
else {
return String.valueOf(((Employee) value).getfirstname());
}
}
I changed this to return the id and it started working as expected.
@Override public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value == null || value.equals("")) {
return "";
}
else {
return String.valueOf(((Employee) value).getId());
}
}
BalusC your effort to explain the theory is hugely appreciated. You're heavensent!