Try our conversational search powered by Generative AI!

SelectionFacroty not working


I have a page which has IList<Fruit> property in CMS. My fruit class has Benefit property. User can add Benefits from the same page in different tabs and those saved benefits are displayed in dropdown of the page. So, I used ISelectionFactory with SelectMany and tried to retrieve the saved benefits to dropdown. But metadata.FindOwnerContent() is giving null in GetSelections method of ISelectionFactory. This does not happen when I use Benefit property directly on the page. I need to identify page, to retrieve the saved benefits so that I can assign one of them to fruit.

In short,

Page has Ilist<fruit> and blocks of benefits.
Fruit class has Benefit property.

I want to map fruits with benefits and benefits itself is created in this page as block type. I could not find page reference or content link  id to retrieve benefits in this case.

Edited, Mar 21, 2019 12:03

Can you show us some code?

Mar 21, 2019 12:13

As I understook the you are needing to get owner content (page or block) from Selection Factory for Benefit propery when this property belongs to IList<Fruit> property.

I hope this code will help in your situation

Mar 30, 2019 12:47


As far as I'm aware, you can't get the owner content from a selection factory (or an attribute) inside an IList<T> property (I've tried various methods). By the looks of it there will be a fix in Epi 12 though I realise that's probably not much consolation right now:

Apr 01, 2019 19:24
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.