Custom data source depending on parameter

I am using a custom data source on a reference selector because the 'Constained By' property doesn't work in my situation. I have an reference in the same object that should have influence on the outcome of the custom data source. The problem is that the outcome only listens to the values that are known on opening of the object(in database). I already tried to commit on change of the reference but this doesn't result in the required outcome. Is there a way to use custom data source or is the only option to use Xpath in combination with commiting the object?
1 answers

Any XPath query requires persisted objects. A retrieve by association less than one deep and starting at the association owner does not require a persisted object.