diff --git a/ChameleonForms.AcceptanceTests/PartialForTests.Should_render_correctly_when_used_via_form_or_section_and_when_used_for_top_level_property_or_sub_property.approved.html b/ChameleonForms.AcceptanceTests/PartialForTests.Should_render_correctly_when_used_via_form_or_section_and_when_used_for_top_level_property_or_sub_property.approved.html
index 265ceb42..72930851 100644
--- a/ChameleonForms.AcceptanceTests/PartialForTests.Should_render_correctly_when_used_via_form_or_section_and_when_used_for_top_level_property_or_sub_property.approved.html
+++ b/ChameleonForms.AcceptanceTests/PartialForTests.Should_render_correctly_when_used_via_form_or_section_and_when_used_for_top_level_property_or_sub_property.approved.html
@@ -11,14 +11,18 @@
Partials
@using (var f = Html.BeginChameleonForm())
{
@f.Partial("_ParentPartial")
+ @f.Partial("_BaseParentPartial")
@f.PartialFor(m => m.Child, "_ChildPartial")
-
+ @f.PartialFor(m => m.BaseChild, "_BaseChildPartial")
+
using (var s = f.BeginSection("This is in the parent view"))
{
@s.FieldFor(m => m.Decimal).Append("in parent view")
@s.Partial("_ParentPartial")
+ @s.Partial("_BaseParentPartial")
@s.FieldFor(m => m.ListId).Append("in parent view")
@s.PartialFor(m => m.Child, "_ChildPartial")
+ @s.PartialFor(m => m.BaseChild, "_BaseChildPartial")
@s.FieldFor(m => m.SomeCheckbox).Append(" in parent view")
}
@@ -51,6 +55,8 @@ Partials
@model ChildViewModel
+This should show the ID of the child field including the parent path: @Html.IdFor(m => m.ChildField)
+
@if (this.IsInFormSection())
{
@:@this.FormSection().FieldFor(m => m.ChildField).Append("From partial against child model")
@@ -64,6 +70,40 @@ Partials
=====
+_BaseParentPartial.cshtml
+
+@model ViewModelExampleBase
+
+@if (this.IsInFormSection())
+{
+ @:@this.FormSection().FieldFor(m => m.BaseField).Append("from partial against top-level model casted to base class")
+}
+else
+{
+ using (var s = this.Form().BeginSection("This is from a form-level partial against the top-level model casted to base class")) {
+ @s.FieldFor(m => m.BaseField2)
+ }
+}
+
+=====
+
+_BaseChildPartial.cshtml
+
+@model ViewModelExampleBaseChild
+
+@if (this.IsInFormSection())
+{
+ @:@this.FormSection().FieldFor(m => m.BaseChildField).Append("From partial against child model in the base class")
+}
+else
+{
+ using (var s = this.Form().BeginSection("This is from a form-level partial against a child model in the base class")) {
+ @s.FieldFor(m => m.BaseChildField2)
+ }
+}
+
+=====
+
Rendered Source