November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
If i remember properly you could set the IList property to specified as a JsonProperty via the library Newtonsoft, something like this:
[Display(
GroupName = SystemTabNames.Content,
Order = 321)]
[CultureSpecific]
[JsonProperty]
[JsonConverter(typeof(UrlConverter))]
[BackingType(typeof(PropertyItem))]
public virtual IList<Item> Items { get; set; }
This should most likely help the convert the properly and read it properly for the Episerver CMS
@Eric: I tried your solution, but the value of Label field still is not showed
Do you get any specific console error in the web console window?
Any errors in Episerver's logs?
Have you decorated your Items property with the CollectionEditorDescriptor?
[EditorDescriptor(EditorDescriptorType =
typeof(CollectionEditorDescriptor<Item>))]
public virtual IList<Item> Items { get; set; }
@Eric: I decorated my Items property with the CollectionEditorDescriptor in ItemEditorDescriptor.cs:
[EditorDescriptorRegistration(TargetType = typeof(IList<Item>))]
public class ItemEditorDescriptor : CollectionEditorDescriptor<Item>
{
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
{
base.ModifyMetadata(metadata, attributes);
}
}
@LeMingDuc: I recently came across another client whom I was suppose to implement the same kind of solution that I had got working for another client.
Turns out I got an error for naming conventions on the properties for the IList type reference property called Name.
I had named my property class to ControlSystem and with a property declared as:
public string Name { get; set; }
This got in conflict with another property declared Name on that page in Episerver.
I see that you named your property to Item - perhaps this get's in conflict aswell in later usages of Episerver?
Or your only property in conflict, the Label property?
I'm also encountering this issue, also only for a calculated field.
Did you manage to resolve this issue by any chance?
I've tried overriding the default CollectionEditorDescriptor js editor, and can see that the calculated field never makes it to the front-end.
Any updates on this issiue?
I'm facing the same problem (computed value isn't shown unless I refresh the editor's UI) and my code is very similar to code posted by original poster. We're using version 11.17.0
I'd be really grateful for any info.
For any late comers to this thread (like me)... it seems this was fixed in version 11.36.0 with a new attribute from EPiServer.Cms.Shell.UI.ObjectEditing namespace called ReloadOnChangeAttribute.
[Display(
GroupName = SystemTabNames.Content,
Order = 321)]
[CultureSpecific]
[BackingType(typeof(PropertyItem))]
[ReloadOnChange]
public virtual IList<Item> Items { get; set; }
In my project, we have a field using IList<Item> in a page type, we have an issue when we edit a page using this page type:
When I add a new value to IList using CollectionEditorDescriptor:
The value of Label is not showed after clicking Add button:
But after refreshing this page, the value of Label is shown again.
My implemtation for this field is:
Page type: StartPage.cs
Item.cs:
PropertyItem.cs:
ItemEditorDescriptor.cs:
Notice: This issue happend after upgrading to Episerver CMS 11. In Episerver CMS 10, no issue.