Error after form Submit

Hi,

After converting form to TemplateForm i'm getting the following error after submit:

{"@odata.context":"http://localhost:5000/odata/pnld/$metadata#ItensReembolsosDespesas","value":[{"ItemReembolsoDespesa":1050,"ReembolsoDespesa":1003,"Tipo":1,"Data":"2018-11-01T00:00:00Z","Origem":null,"Destino":null,"Entrada":null,"Saida":null,"Referencia":null,"Empresa":null,"ValorGasto":10.0000,"ValorConcedido":10.0000}]}

The actual server error can be observed in the Radzen output pane.Can you check it?

Hi enchev,

This is the last info in the output pane:

dotnet: info
dotnet: : Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1]
Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext.
info
dotnet: : Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action Pnld.Controllers.Pnld.ItensReembolsosDespesasController.Post (server) in 5.4496ms

dotnet: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 6.3107ms 400 application/json; odata.metadata=minimal; odata.streaming=true; charset=utf-8

Hi enchev,

The error is one form field value that is set by a parameter from parent window. The value of this field is lost when i change the value from "Tipo" filed. This field has change event. This was working fine before i change the form to template form.

The standard Form Change event cannot be handled when converting to TemplateForm. If this is your scenario you should add manually to the TemplateForm components what's missing. More info can be found here:

I'm already using the input change event. The problem is when i save the form after firing the input change event the value of the foreign key input is lost.

After the last version update its working but only if the input is visible and enabled.If i set the input to disabled its value is lost on form submit.

Unfortunately it isn't clear what your code is doing. You can log the current form value before submitting it to see if everything is correct. In addition you can inspect how the HTTP request looks like - the form content is serialized as JSON.

korchev, my add page have a dropdownlist that is a foreign key related to the parent window. This field is passed by as a parameter to the add page. If i set this field to invisible or disabled its value is not posted when i submit the form. This is only happening after i set the form to templateForm.