I'm using a Loop in a Form to create a list of checkboxes. I'm having trouble getting hold of the list after it has been submitted. How is it possible to get hold of the collection of objects associated with the loop?
The individual checkBoxItems get serialised fine, but a persisted list of them (the List is set in the getCheckBoxListItems() method) seems to be recreated with different items (different object id's). I've found a way to make it work, by using a PrimaryKeyEncoder and adding all the items to a Set<CheckBoxItem> in the toValue(Long key) method. This doesn't seem a transparent and robust way to do it. Better suggestions? Szemere Skeleton code: private Set<CheckBoxItem> encoderItems = new HashSet<CheckBoxItem>(); private final PrimaryKeyEncoder<Long,CheckBoxItem> encoder = new PrimaryKeyEncoder<Long,CheckBoxItem>() { //other methods removed for clarity public CheckBoxItem toValue(Long key) { CheckBoxItem item = lookup(key); encoderItems.add(item); return item; } };