Replies: 2 comments 1 reply
-
If you have MyAwesomeComponent.razor <TextEdit Text="@MyData" TextChanged="@MyDataChanged" TextExpression="@MyDataExpression"/>
@code{
[Parameter] public string MyData {get;set;}
[Parameter] public EventCallback<string> MyDataChanged { get; set; }
[Parameter] public Expression<Func<string>> MyDataExpression { get; set; }
} Usage <Validation>
<MyAwesomeComponent @bind-MyData="MyModel.Field4" MyDataExpression="@(()=>MyModel.Field4)">
<Feedback>
<ValidationError />
</Feedback>
</MyAwesomeComponent>
</Validation> or (MyDataExpression might work automatically with Blazor) <Validation>
<MyAwesomeComponent @bind-MyData="MyModel.Field4">
<Feedback>
<ValidationError />
</Feedback>
</MyAwesomeComponent>
</Validation> |
Beta Was this translation helpful? Give feedback.
-
The expression is kinda secret Blazor feature and it's not documented that much. Not a lot of people know about it. Glad I could help :) |
Beta Was this translation helpful? Give feedback.
-
Hello,
In my knowledge, it is not possible to create a custom component and use it with the Blazorise validation, isn't it ?
ex:
Create a custom component MyAwesomeComponent in which you put what you want, like a label + some TextEdits
You want to use it in a big form where you use Blazorise validation
Any possibilities to achieve it or an equivalent ?
If not, is it possible to consider this feature in future developments ?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions