This is the decompiled ListFieldItem
using System;
namespace Sitecore.ExperienceForms.Mvc.Models
{
[Serializable]
public class ListFieldItem
{
public string ItemId { get; set; }
public bool Selected { get; set; }
public string Text { get; set; }
public string Value { get; set; }
}
}
The ItemId is the referenced Item being used. Therefore, you could have multiple fields on your item's template and then you could get to use them pretty easily. Here is a little snippet on how I used a CssClass field on an item template and use it within RadioButtonList.cshtml
@using Sitecore.ExperienceForms.Mvc.Html
@using Sitecore.Data;
@model Sitecore.ExperienceForms.Mvc.Models.Fields.ListViewModel
<label class="@Model.LabelCssClass">@Html.DisplayTextFor(t => Model.Title)</label>
@foreach (var item in Model.Items)
{
<label class="@Model.CssClass">
<input class="@Sitecore.Context.Database.GetItem(new ID(item.ItemId)).Fields["CssClass"]" type="radio" name="@Html.NameFor(m => Model.Value)" @if (item.Selected) { <text> checked</text>} value="@item.Value" data-sc-tracking="@Model.IsTrackingEnabled" data-sc-field-name="@Model.Name" data-sc-field-key="@Model.ConditionSettings.FieldKey" @Html.GenerateUnobtrusiveValidationAttributes(m => m.Value) />@item.Text
</label>
}
@Html.ValidationMessageFor(m => Model.Value)
Depending on your needs, I think this could do the trick.
You would end up having your 2 dropdowns from your Datasource Item's fields...
@{
var contextItem = Sitecore.Context.Database.GetItem(new ID(item.ItemId));
if(contextItem != null)
{
var dropdownA = contextItem.Fields["dropdownA"];
var dropdownB = contextItem.Fields["dropdownB"];
}
}