November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Hi @Nickolson,
For me, I've resolved the issue because the CollorCollection was inside the PredefinedColorPickerBlock.
The updated code right now (which now works) is this:
namespace Foundation.Features.Forms.Elements
{
[ContentType(DisplayName = "Predefined Colorpicker",
GUID = "13bfd1d2-c51d-4da0-b6b0-d1634177f8eb",
GroupName = "Configuration Question Elements")]
public class PredefinedColorpickerBlock : InputElementBlockBase
{
[Display(
Name = "Color Hex Values",
Description = "Color hex value",
GroupName = SystemTabNames.Content,
Order = 10)]
[EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor<ColorCollection>))]
public virtual IList<ColorCollection> ColorHexValues { get; set; }
[PropertyDefinitionTypePlugIn]
public class ColorListProperty : PropertyList<ColorCollection>
{
protected override ColorCollection ParseItem(string value) => JsonConvert.DeserializeObject<ColorCollection>(value);
}
}
public class ColorCollection
{
[ClientEditor(ClientEditingClass = "foundation/editors/ColorPicker")]
[Display(Name = "Hex Value", GroupName = SystemTabNames.Content, Order = 10)]
public virtual string HexValue { get; set; }
}
}
Hi, I've tried to create a custom from element wth a list of objects using CollectionEditorDescriptor with the code I have below:
but when trying to edit the form element, the console returns an error 404 (screenshot below)
Is there something I'm missing?
I've tried searching around and found that the URL that dojo is trying to get has a + sign /episerver/shell/Stores/metadata/Foundation.Features.Forms.Elements.PredefinedColorpickerBlock+ColorCollection?dojo.preventCache=1631153602140 and thought that was the one causing the issue, so I've tried adding allowDoubleEscaping="true" into the web.config (not quite sure on this might be the solution as well cause this might cause security issues in the future) and somehow got the form element working.
but now, the form doesn't get submitted and sends me this error:
can anyone guide me on this one? or has anyone gotten into this issue as well and found a solution?
Update: I somehow resolved the submit issue but still wondering if there are any workaround on the CollectionEditorDescriptor issue.
Update 2: Somehow forgot about this issue and found the culprit. I've mistakenly placed the ColorCollection class inside the PredefinedColorpickerBlock. 🤪