There are two ways to solve it:
1.) If you have a direct access to the CommissionEditor
then create a setter in it call it when you edit the entity:
public void setAcceptableValues(List<CommissionType> values) {
type.setAcceptableValues(values);
}
And call it like this when you call driver.edit(entity);
:
commissionEditor.setAcceptableValues(commission.getCommissionTypes());
2.) Instead of extending the Editor
interface you can extend the ValueAwareEditor and in the setValue()
method call setAcceptableValues
with the corresponding values.
Approach 2 is probably the cleaner approach.