I am creating a customised dropdown field using the FieldTypes in a custom Theme.
FieldType.DropDownList.cshtml uses a FieldViewModel and I need to find the form that the fields are children of, because I need to look up some values using the Form-Name.
Anyone got a clue on how to get a reference to the Form from the FieldViewModel of the field?
Get Form from FieldViewModel ?
I am creating a customised dropdown field using the FieldTypes in a custom Theme.
FieldType.DropDownList.cshtml uses a FieldViewModel and I need to find the form that the fields are children of, because I need to look up some values using the Form-Name.
Anyone got a clue on how to get a reference to the Form from the FieldViewModel of the field?
Ha! - answered my own question.
Fortunately, the requirement is from the Themed FieldType being called from the Themed Form, as:
So, I just needed to extend that out with a ViewDataDictionary and pass what I needed to the Themed FieldType as:
Perhaps not the most elegant of solutions, but it works for now.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.