I'm trying to build a component that uses the build in component 'InputNumber' like this :
Child :
@typeparam T
<InputNumber TValue="T" Value="@ValueChild" @onchange="OnValueChildChanged" id="input1" />
@code {
[Parameter]
public T ValueChild { get; set; }
[Parameter]
public EventCallback<T> ValueChildChanged { get; set; }
public async Task OnValueChildChanged(ChangeEventArgs e)
{
ValueChild = (T)e.Value;
await ValueChildChanged.InvokeAsync(ValueChild);
}
}
and I call it like this:
Parent
<InputNumberPerso T="int?" @bind-ValueChild="@ForumuleModel.FR_TPSMALA"> </InputNumberPerso>
but I get this error message; What am I doing wrong ?
> blazor.webassembly.js:1 crit:
> Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
> Unhandled exception rendering component: Microsoft.AspNetCore.Components.Forms.InputNumber`1[System.Nullable`1[System.Int32]]
> requires a value for the 'ValueExpression' parameter. Normally this is
> provided automatically when using 'bind-Value'.