You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Justin Mckay <ju...@famis.com> on 2008/03/25 23:50:26 UTC

[Trinidad] tr:selectOneChoice and Objects that cannot override equals

I have a situation where I have some generated objects that do not override
equals that I would like to use in a selectOneChoice field.  The  issue is
the selected object may not be the same object from the list of objects in
the selectItems.  For instance:

 

<tr:selectOneChoice value="#{bean.person}">

     <f:selectItems value="#{peopleFinder.people}"/>

</tr:selectOneChoice>

 

So here bean.Person is a generated type Person and peopleFinder.people will
be a Map<String,Person> of the same generated type.

 

The way we have been handeling this is we have been wrapping the objects
with another object that has a properly implemented equals method.  This
works but requires us to write more code, I was thinking there would be an
easier way to do this, any ideas?

 

Thanks,

 

Justin