I have a data model in which I have an Item
that can belong to one or more Categories
. I'm trying to display a <rich:listShuttle />
allowing the user to select which Categories
the Item
should belong to. I'm using RichFaces and Seam 2.2.x, and haven't run into any problems in setting the values initially. My source is a list of the defined Categories
, while my target is the Item.values()
attribute. Everything works fine when setting the Categories
for the first time.
However, when I go in to edit an Item
and change the Categories
it is in, my <rich:listShuttle />
source list contains all of the Categories
, not just the one the Item
is not currently in. As a result, it is possible to move a duplicate Category
from the source over to the target. This creates problems when I try and commit my Item
to the database.
Is there any way to prevent these duplicates from being set? I would think there was a flag I could set, but haven't found anything yet.