Skip to content

Child-Binding don't work #9612

Closed
Closed
@UrielMhezzek

Description

@UrielMhezzek

I want to make a inputlayout for all my paramters on my hero-object. i start with the name of the instance of my hero-object.

In first Line the normal Inputfield. It works, in second line, the Inputfield-Component, that don't work.

        <input type="text" bind-value-oninput="@hero.Name" />
        <InputField Label="Name" bind-Value="@hero.Name"></InputField>

inputfield.csthml

<div class="form-group @(Orientation == InputFieldOrientation.Horizontal ? "row" : "")">
    <label class="col-sm-2 col-form-label">@Label</label>
    <div class="col-sm-10 @(Orientation == InputFieldOrientation.Horizontal ? "text-center" : "")">
        <input class="form-control form-control-dark w-100" type="text" placeholder="@Label" bind-value-oninput="@Value" />    </div>
</div>

@functions {
    [Parameter] private string Label { get; set; }
    [Parameter] private string Value { get; set; }
    [Parameter] private Action<string> ValueChanged { get; set; }
    [Parameter] private InputFieldOrientation Orientation { get; set; } = InputFieldOrientation.Horizontal;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions