sitefinity

Sitefinity DesignerView add choices to custom FormControlsToolboxName


I am building this FormControls widget and have added some controls like sf-html-field and sf-image-field. I am at the point where I want to add the Choices and not sure how best to do that. I want to it work the same way the built-in MultipleChoiceField control work.

DesignerView.Simple

<form>
    <div class="form-group">
        <label for="heading-text">Label (Question)</label>


        <sf-html-field class="kendo-content-block"
                       sf-model="properties.Question.PropertyValue">
        </sf-html-field>

    </div>

    <div class="form-group">
        <label for="image-field" class="m-top-sm">@Html.Resource("Image")</label>
        <sf-image-field class="sf-Media--info modal-settings modal-settings-space"
                        sf-model="properties.ImageId.PropertyValue"
                        sf-image="selectedImage"
                        sf-provider="properties.ImageProviderName.PropertyValue"
                        sf-media-settings="@SettingsHelpers.GetMediaSettings("Image")"
                        id="image-field">
        </sf-image-field>
    </div>

    <div class="form-group">
        <label for="heading-text">Choices</label>

    </div>
</form>

Add

enter image description here


Solution

  • You can see the implementation of the default designer view here:

    https://github.com/Sitefinity/feather-widgets/blob/master/Telerik.Sitefinity.Frontend.Forms/Mvc/Views/MultipleChoiceField/DesignerView.Simple.cshtml#L20-L64