volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

How to use PropertyCheckBoxList

How to define property using PropertyCheckBoxList? What should be the type of this property?

Thanks

#74635
Sep 03, 2013 12:10

More general question would be: how to use "Custome Property Types"

#74636
Sep 03, 2013 12:12

We are using approach below:

[EditorDescriptorRegistration(TargetType = typeof(string), UIHint = "ListOfChoices")]
public class ListOfChoicesEditorDescriptor : EditorDescriptor
{
    public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
    {
        SelectionFactoryType = typeof(ListOfChoicesFactory);
        ClientEditingClass = "epi-cms.contentediting.editors.CheckBoxListEditor";
        base.ModifyMetadata(metadata, attributes);
    }
}

public class ListOfChoicesFactory: ISelectionFactory
{
    public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
    {
        var options = new List<SelectItem>
            {
                    new SelectItem { Value = "value", Text = "text" }
            };

        return options;
    }
}  

    

And then in page type:

[Display(GroupName = SystemTabNames.Content, Order = 20)]
[UIHint("ListOfChoices")]
public virtual string Choices { get; set; }

    

#74639
Sep 03, 2013 12:45

@Valdis, I have tried and I get 404 from http://localhost/secureUI/Shell/1.0.456/ClientResources/dtk/epi-cms/contentediting/editors/CheckBoxListEditor.js

any idea?

#74645
Sep 03, 2013 13:13

Interesting mine is coming from "{secureUI}/CMS/2.1.82/ClientResources/EPi/Cms/contentediting/editors/CheckBoxListEditor.js"

#74646
Sep 03, 2013 13:42
Vote:

The client widgets changed root namespace in the 7.2 UI upgrade. For 7.1 the namespace should start with "epi.cms" and for 7.2 "epi-cms".

#74654
Sep 03, 2013 14:49

Indeed Linus :) It helped.

#75086
Sep 17, 2013 12:32
error This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.