Skip to content

Create TextAreaExtensionProperty to support multiline object extension for blazor ui #22936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,17 @@ public static Type GetInputType(this ObjectExtensionPropertyInfo propertyInfo)
switch (dataTypeAttribute.DataType)
{
case DataType.Password:
return typeof(TextExtensionProperty<,>);
case DataType.Date:
return typeof(DateTimeExtensionProperty<,>);
case DataType.Time:
return typeof(TimeExtensionProperty<,>);
case DataType.EmailAddress:
return typeof(TextExtensionProperty<,>);
case DataType.Url:
return typeof(TextExtensionProperty<,>);
case DataType.PhoneNumber:
return typeof(TextExtensionProperty<,>);
case DataType.Date:
case DataType.DateTime:
return typeof(DateTimeExtensionProperty<,>);
case DataType.Time:
return typeof(TimeExtensionProperty<,>);
case DataType.MultilineText:
return typeof(TextAreaExtensionProperty<,>);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@typeparam TEntity
@typeparam TResourceType
@using Volo.Abp.BlazoriseUI
@using Volo.Abp.Localization
@inherits ExtensionPropertyComponentBase<TEntity, TResourceType>

@if (PropertyInfo != null && Entity != null)
{
<Validation Validator="@Validate" MessageLocalizer="@LH.Localize">
<Field>
<FieldLabel>@PropertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)</FieldLabel>
<MemoEdit @bind-Text="@Value" AutoSize Disabled="IsReadonlyField">
<Feedback>
<ValidationError/>
</Feedback>
</MemoEdit>
</Field>
</Validation>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Volo.Abp.Data;

namespace Volo.Abp.BlazoriseUI.Components.ObjectExtending;
public partial class TextAreaExtensionProperty<TEntity, TResourceType>
where TEntity : IHasExtraProperties
{
protected string? Value {
get {
return PropertyInfo.GetTextInputValueOrNull(Entity.GetProperty(PropertyInfo.Name));
}
set {
Entity.SetProperty(PropertyInfo.Name, value, validate: false);
}
}
}
Loading