Take the community feedback survey now.
AI OnAI Off
Take the community feedback survey now.
I got help from Linus Ekström, who pointed me to this blog post by Alexander Haneng which solved my problem:
http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2013/1/Getting-EPiServer-6-custom-properties-to-work-in-EPiServer-7-Cannot-create-and-populate-list-type/
I have read http://world.episerver.com/Modules/Forum/Pages/thread.aspx?id=60674 but I can't see if I have problem with JSONConverter.
My Property:
[UIHint("spdocument")] [BackingType(typeof(PropertyExternalDocument))] public virtual ExternalDocument Document { get; set; }My property:
public override object Value { get { var value = base.Value as string; if (value == null) { return null; } var identifier = GetIdentifier(value); var fileName = GetFileName(value); return new ExternalDocument {FileName = fileName, Identifier = identifier}; } set { if (value is ExternalDocument) { var ed = value as ExternalDocument; base.Value = String.Format("{0} [{1}]", ed.FileName, ed.Identifier); } else { base.Value = value; } } }My editor wored fine until I added the backing type (it was storing string before). Do I have to do anything in my editor so that Value's set is called? Right now the autosave only calls get and I receive the following error:
Something went wrong
In the Alloy sample site's StringList property the editor converts the string to an array before calling this.onChange(list).
In my editor I only calls onChange with the string, I thought that PropertyExternalDocument Value property could handle transition from string to object, but I may hav missunderstood this?