Umbraco Forms Partial submission on v8 constructor
Hi
v8 for forms doesn't allow parameterless constructor when inheritting from
UmbracoFormsController
class. So for instance if I want to override OnFormHandled method like I do in v7, I'll now need to provide Instances for several classes. Question here is where do I get these instances without newing up on each request?
Does anyone know how to provide instances to these parameters. Are we using DI in umbraco v8 which does that for us?
I really like Umbraco forms and we are running umbraco cloud but this is becoming an issue as there are several custom umbracoformcontrollers we use for v7, we need to build for providing partial form submission. If you know other ways to partially submit forms using Umbraco forms in v8 please let me know. This is our major hold back on v8
By partial submission i mean, on each next button press data is saved to DB before Resuming to next page of the form.
Umbraco Forms Partial submission on v8 constructor
Hi
v8 for forms doesn't allow parameterless constructor when inheritting from
class. So for instance if I want to override OnFormHandled method like I do in v7, I'll now need to provide Instances for several classes. Question here is where do I get these instances without newing up on each request?
Here is v8 constructor parameters:
Does anyone know how to provide instances to these parameters. Are we using DI in umbraco v8 which does that for us?
I really like Umbraco forms and we are running umbraco cloud but this is becoming an issue as there are several custom umbracoformcontrollers we use for v7, we need to build for providing partial form submission. If you know other ways to partially submit forms using Umbraco forms in v8 please let me know. This is our major hold back on v8
By partial submission i mean, on each next button press data is saved to DB before Resuming to next page of the form.
Hi Ash,
Yes Umbraco has DI that should handle all those.
Matt
Thanks Matt, could u please share a snippet on how can I grab the instance from Umbraco DI many thanks
You shouldn't need to do any DI the composer's should all be wired up so you can do
public MyUmbracoFormsController(DistributedCache distributedCache, IFormStorage formStorage, IRecordStorage recordStorage, IRecordService recordService, FieldCollection fieldCollection, IFieldTypeStorage fieldTypeStorage, IFieldPreValueSourceService fieldPreValueSourceService, IFieldPreValueSourceTypeService fieldPreValueSourceTypeService, IUmbracoContextAccessor umbracoContextAccessor) :base(params) {
Sorry about formatting am on my phone
Thanks Matt for pointing in right direction.. I will run through DI route
Hey did you ever get this sorted?
I'm needing to do the same thing, so if you have any info or snippets that could help me that would be great, Thanks
Does anyone have any working code sample for Umbraco 8 and Forms 8 that can do partially saved data in forms?
Thanks in advance.
is working on a reply...