You will need to implement and register a Converter for the MyClass class. The Converter handles the conversion from server side java object to client side string representation.
Eg.
[code]
@javax.faces.convert.FacesConverter(forClass=MyClass.class)
public MyClassConverter implements javax.faces.convert.Converter {
public Object getAsObject(FacesContext context, UIComponent component, String value) {
return new MyClass(value);
}
public String getAsString(FacesContext context, UIComponent component, Object value) {
return ((MyClass) value).getUniqueName();
}
}
[/code]
Further ensure that the object has proper implementations of hashCode and equals.
[Message sent by forum member 'janderssn']
http://forums.java.net/jive/thread.jspa?messageID=478306