Well, this is odd. Can you provide some *simple* sample code demonstrating this? By simple, I mean where all non-relavant code has been removed.
Hi Brian
I made a simple app:
As you see in ItemBean's constructor, depending on the way I build the selectedList, it gets displayed properly or not
the project is using ivy for dependencies, and is build using ant tasks
should build the war file in /dist
(I now need to figure out how to attach a file to this message :-)
Thanks Jean-Noel Collin for your persistence with this issue. I ran your sample, and can confirm the behavior you describe. The fix is to override hashCode for your Item Object, my IDE generated the following hashCode for me:
@Override public int hashCode() { return (int) (id ^ (id >>> 32)); }
This however is less than ideal. While the HashSet used may lead to an efficient implementation, in practice pickList value collections are small enough that iterating over the elements is sufficient.
Can you file a jira issue requesting that we change our implementation to not require the implementation of the hashCode method in the Data objects? To implement this, we can simply iterate over the collection, invoking the equals method on the individual objects. This will make it easier for folks to use the pickList.
Thanks!
Brian Leathem