Could you elaborate how the reference is not set in the first screenshot? The association is also an one to many.
I would say step back and work through the steps that you know must happen. Make sure both objects exist, then set the association between them and make sure that you commit both objects.
Once you have confirmed this and there is still n problem start with checking your security on the entities, do you have write access to the association and other stuff. If this is confirmed, check the retrieve you use to display the data. And if that does not work let someone review the work.