Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Cannot register custom editor descriptor for boolean

Found in

EPiServer.CMS.UI 10.0.2

Fixed in

EPiServer.CMS.UI 10.9.5

(Or a related package)

Created

May 11, 2017

Updated

Jun 08, 2017

Area

CMS UI

State

Closed, Fixed and tested


Description

We believe that this issue only occurs from CMS.UI 10 and forward because of changes made in CMS.Core 10.

Steps to reproduce:
1. On StandardPage.cs in Alloy templates, add this boolean property:

public virtual bool IsTrueOrNot { get; set; }

2. Add this EditorDescriptor:

    [EditorDescriptorRegistration(TargetType = typeof(bool))]
    public class BooleanEditorDescriptor : EditorDescriptor
    {
        public BooleanEditorDescriptor()
        {
            ClientEditingClass = "dijit/form/TextBox";
        }
    }

3. Create a page of type standardpage.
4. Go to all properties mode and edit the new property.

Expected
The IsTrueOrNot property is displayed as a textbox.

Actual
The property is still a regular checkbox

Note: Also, setting a matching UIHint on the boolean property does not work.

 [UIHint(BooleanEditorDescriptor.UIHint)]
 public virtual bool IsTrueOrNot { get; set; }
 
...
 
[EditorDescriptorRegistration(TargetType = typeof(bool), UIHint = UIHint)]
public class BooleanEditorDescriptor : EditorDescriptor
{ 
    public const string UIHint = "CustomBool";
    ... 
}