Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gavin Williams 53 posts 246 karma points
    May 30, 2018 @ 13:02
    Gavin Williams
    0

    Viewmodel in Umbraco Forms custom fields

    In Umbraco v6 Contour you could pass any custom viewmodel to the view that rendered your fieldtype whereas now it appears you must pass a FieldViewModel. In Forms.cshtml the line

     @Html.Partial(FormThemeResolver.GetFieldView(Model, f), f)
    

    blows if this is not the case. The same line in v6 reads

    @Html.Partial(FormViewResolver.GetScriptView(Model.FormId), Model)
    

    Does anyone know how/if you can pass a custom viewmodel under v7 or are you restricted to adding individual string properties (or passing as a json string) to AdditionalSettings and handling those at "either end" of the forms process to wrap and unwrap my custom object?

    I'm in the process of converting an existing v6 site which contains custom Contour field types (in this case an address search/lookup control to our in-house address database).

Please Sign in or register to post replies

Write your reply to:

Draft