Aaltuj / VxFormGenerator

The library contains a component, that nests itself into the Blazor EditForm instead of a wrapper around the EditForm. The component is able to generate a form based on a POCO or a ExpandoObject. Because of this architecture the library provides the developer flexibility and direct usage of the EditForm.
MIT License
119 stars 36 forks source link

@bind not valid attribute #14

Closed msaroka closed 3 years ago

msaroka commented 3 years ago

I am trying out the Nuget 0.11 version and it is showing the label and laying out the grid just fine, but the control is not shown and the below error is generated in the output window. I am using .NET 5.

System.AggregateException: One or more errors occurred. (InvalidCharacterError: Failed to execute 'setAttribute' on 'Element': '@bind' is not a valid attribute name.) ---> System.InvalidOperationException: InvalidCharacterError: Failed to execute 'setAttribute' on 'Element': '@bind' is not a valid attribute name. at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)

Aaltuj commented 3 years ago

hi @msaroka could you provide a reproduction of your error.

msaroka commented 3 years ago

It took a while to find the combination of things that call this error. Create a class that will be the model type of the EditForm. One property must be a bool type. Load the class in the OnInitializedAsync method of the form and assign it to the local field that is the model of the form If the loaded object has a true value in the bool property the error will trigger. it will not if it is false.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Aaltuj commented 3 years ago

Sorry, i was quite busy with other stuff. Great that you found the combination. I would love to help if you are able provide that code.

msaroka commented 3 years ago

In FeedingSession.cs change the line to:

public bool ThrowingUp { get; set; } = true;

This will cause the error.