Actually that problem is resolved with
foreach (var item in Model.Items)
{
<li>
@Html.CheckBox("Options",false, htmlAttributes)
@Html.DisplayFor(m => item.Text)
</li>
}
Howver, how would I bind the checkbox value and save it as form record in cms. I am using Options properties of the form which is a default/system property. I am using SelectorProperties and SelctorFormComponent
public class CheckBoxListComponent : SelectorFormComponent<CheckBoxListComponentProperties>
{
public const string IDENTIFIER = "CheckBoxListComponent";
[BindableProperty]
public string Options { get; set; }
public override string GetValue()
{
return Options;
}
public override void SetValue(string value)
{
if (!string.IsNullOrEmpty(value))
{
Options = value;
}
else
{
SetValue("All");
}
}
}
public class CheckBoxListComponentProperties : SelectorProperties
{
}