Developer forum

Forum » Dynamicweb 10 » Forms for Editors for ViewModel

Forms for Editors for ViewModel

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi,

It seems I'm making a habit of asking for features that are already largely there ;-) like this one on the Forms Module: https://github.com/dynamicweb/DynamicWeb/issues/385

The Forms for Editors for ViewModel works with Centralised Apps Settings I noticed, which solves a bunch of the issues I experienced.

However, when I add the App, and set it to the Default.cshtml template, nothing is shown, also no errors are logged, there is just a blank div basically. 

Am i missing something?


Replies

 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

For reference in case anybody else runs into this:

 

Swift 2 does not include a standard template for this app yet, so you will need to create your own. Below is a simple example that prints all data from the viewmodel to help you get started.

@inherits ViewModelTemplate<FormViewModel>

@using Dynamicweb.Rendering

@using Dynamicweb.Frontend

@using Dynamicweb.Forms;



<div>    

@Model.ToJson()</div>

<hr />

<div>    

@Model.Fields.FirstOrDefault()?.ToJson()

</div>

 

You must be logged in to post in the forum