You shouldn't set the SelectionFactoryType or ClientEditingClass in the ModifyMetadata. You should do that in your constructor instead.
[EditorDescriptorRegistration(TargetType = typeof(string), UIHint = "Tagging")]
public class PersonEditorDescriptor : EditorDescriptor
{
public PersonEditorDescriptor()
{
SelectionFactoryType = typeof(TagSelectionFactory);
ClientEditingClass = "epi.cms.contentediting.editors.CheckBoxListEditor";
}
}
After upgrading to 7.1 you need to change the client edtiting class away from the dot-syntax. Something to do with upgrading some dojo stuff to 1.8.
See section "Dojo 1.8 upgrade"
Something like "epi-cms/contentediting/editors/CheckBoxListEditor" should work. If this is related to a 7.1-version, that is.
Why it works for drop down lists and not check box lists after upgrading I don’t understand, though.
Yeah that did the trick. However when I save the page and then go back to edit mode the checkboxes are not checked. Am I missing something or do I have to check them all by myself (how to set checked=true then?).
EDIT: Should also say that the tag name and value are different (E.g. Fruits => 1)
Try to set the value on the select items to a string (Value = n.ToString()) when you create select items in your selection factory class. That should solve the pre-selecting issue I think. It seems like string are the only way to go when dealing with these select item values.
I currently have my values as strings as such "Small|s|1.00" is there a reason i cannot select multiple in my checkbox list. I have updated the framework to the proper dojo "epi-cms/contentediting/editors/CheckBoxListEditor" and all the fun jazz. it only allows me to save one value, when i select another checkbox in the checkbox list, the values go blank. I also am having the preselect issue as well.
For properties whose value are array, you need to set "multiple" attribute to true in your editor widget.
Hey Duong, I guess I am not sure what you are referring to as "Multiple" attribute to true for your editor widget. Am I missing something. I do not see it referenced or documented anywhere. Apologize for my simple question. This is what i have.
[EditorDescriptorRegistration(TargetType = typeof(EOptionCollection), UIHint = EOptionUIHints.EOptionHints.EOptionCheckBoxLists)]
public class EOptionCheckBoxListsEditorDescriptor : EditorDescriptor
{
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
{
SelectionFactoryType = typeof(EOptionCheckBoxlistsSelectionFactory);
ClientEditingClass = "epi-cms/contentediting/editors/CheckBoxListEditor";
base.ModifyMetadata(metadata, attributes);
}
public class EOptionCheckBoxlistsSelectionFactory : ISelectionFactory
{
public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
{
PropertyData propertyData = metadata.Model as PropertyData;
if (propertyData == null)
{
yield break;
}
EOptionSettings settings = (EOptionSettings)propertyData.GetSetting(typeof(EOptionSettings));
foreach (EOptionItem item in EOptionCollection.ParseJson(settings.EOptionCollectionString))
{
yield return new SelectItem { Text = item.Name, Value = item.ToString() };
}
}
}
}
Basically, you should just have to add the following code in the ModifyMetadata method:
EditorConfiguration["multiple"] = true;
Read more about how to define settings here: http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2013/4/Sending-settings-from-the-server-to-your-edito
I only had this problem when having a Container Page (without template) and a property refering to an editordescriptor with ClientEditingClass = "epi.cms.contentediting.editors.CheckBoxListEditor"
Changing to "epi-cms/contentediting/editors/CheckBoxListEditor" helped, thanks!
Is it possible to add some information about the name convention changes to the SDK, documentation and articles written by EPiServer? That developer blogs still have the old convention is kinda hard to fix but having the official documentation corrected would be nice.
There is documentation about this in the release notes. http://world.episerver.com/Documentation/Items/Release-Notes/EPiServer-CMS/EPiServer-7/Release-Notes--EPiServer-7-1-CMS/?id=66142&epslanguage=en#js
But this is probably not visible enough. I can talk to the documentation team to see if we can make this more visible in the SDK.
Yeah I've read that but that part must have slipped my mind when it stopped working for me.
I think updating the original articles would be good for new developers that might now have updated themselves with the new patches and updates. If you could push some changes it would be nice.
1. I have updated the sample with the 7.1 namespaces.
2. Regarding future improvements I hope we can add descriptor base classes that makes this even simpler for the next release so you don't have to care about the editors being used.
Hi.
I am working on a tagging-system where I want to implement a CheckBoxListEditor for the tags. However wwhen I set the ClientEditingClass to epi.cms.contentediting.editors.CheckBoxListEditor the formediting does not load. (The loading-gif just keeps working). When I use SelectionEditor instead it works but I need to be able to use multiple tags.
Property definitions
EditorDescriptor:
TagSelectionFactory:
Thanks in advance,
David Rutqvist