This content has been marked as final.
Show 3 replies
-
1. Re: Problem with s:selectItems not showing correct value
nickarls Oct 12, 2007 6:06 AM (in response to david.spark)"david.spark" wrote:
Using the h:outputText in the above code I can see the problem is that the ID's of the entity beans are different between the saved value and the values in the list. I'm wondering if part of the problem is that webUser is session scoped and that maleTops is a framework query defined in components.xml meaning I'm getting 'different' entities back.
Override the equals() and hashCode() of the entity. -
2. Re: Problem with s:selectItems not showing correct value
pmuir Oct 12, 2007 6:47 PM (in response to david.spark)Do you really mean the ids are different - if the ids are different then you won't get the objects selected. Do you mean the hashcode - in which case, yes, the session scope is probably the problem and nickaris's solution is probably correct - either that or follow the pattern i documented on the wiki for managing entities in scopes longer than conversation
-
3. Re: Problem with s:selectItems not showing correct value
david.spark Oct 16, 2007 11:57 AM (in response to david.spark)Yes sorry, I meant the hashcode. Overriding the two methods as suggested fixes the problem nicely. Thanks for the help.