AI OnAI Off
Hi,
I'm not sure, but maybe in your GroupSelectionFactory you are using EPiServer.Shell.ObjectEditing.ISelectionFactory, but you should EPiServer.Personalization.VisitorGroups.ISelectionFactory:
public class GroupSelectionFactory : EPiServer.Personalization.VisitorGroups.ISelectionFactory { // you should implement different methd /* public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata) { // Get stuff from db return allGroups.Select(group => new SelectItem { Text = group.GroupName, Value = Convert.ToString(group.GroupId) }); } */ public IEnumerable<SelectListItem> GetSelectListItems(Type propertyType) { // Get stuff from db return allGroups.Select(group => new SelectItem { Text = group.GroupName, Value = Convert.ToString(group.GroupId) }); } }
Hi, Grzegorz Wiecheć
And thank you. That was it. The documentation could be clearer on which interface to implement, but now when I see it, it's obvious.
One could argue that ISelectionFactory for both interfaces was not the best naming :)
Hi,
I've followed the documentation on creating criterions:
http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Personalization/Personalization/
However when I try to drop in the new critierion I get an Object reference not set to an instance of an object.-exception.
If I remove the "SelectionFactoryType"-property on the "DojoWidget"-attribute everything works fine.
If I create a custom UI the exception is thrown on Line 3
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Attaching full exception details below: