Closed romaluca closed 2 months ago
I have an array of strings, Place.Sites, that I'm trying to manage using the HxInputText component. My current code looks like this:
@for (int x=0; x < Place.Sites.Count();x++) { int i = x; <p> <HxInputText Label="Sites" @bind-Value="Place.Sites[i]" /> </p> }
However, this code raises the following error:
InvalidOperationException: Sequence contains no elements System.Linq.ThrowHelper.ThrowNoElementsException() System.Linq.Enumerable.Single(IEnumerable source) Havit.Blazor.Components.Web.Bootstrap.HxInputBase.GetValueAttribute() Havit.Blazor.Components.Web.Bootstrap.HxInputTextBase.BuildRenderInput(RenderTreeBuilder builder) Havit.Blazor.Components.Web.Bootstrap.HxInputBase.Havit.Blazor.Components.Web.Bootstrap.Internal.IFormValueComponent.RenderValue(RenderTreeBuilder builder)
if I switch to the standard InputText component, the code works as expected:
@for (int x=0; x < Place.Sites.Count();x++) { int i = x; <p> <InputText Label="Sites" @bind-Value="Place.Sites[i]" /> </p> }
How can i use HxInputText instead of InputText? Thanks
Thanks for reporting this. I was able to reproduce the issue and it is fixed now. Will be part of next release.
I have an array of strings, Place.Sites, that I'm trying to manage using the HxInputText component. My current code looks like this:
However, this code raises the following error:
if I switch to the standard InputText component, the code works as expected:
How can i use HxInputText instead of InputText? Thanks