diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 083e700462424d386afdb880fddfb6965ff62371..45c2abcc9b7f58aede8c495d6baa169207a70a99 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 6.6.7 + 6.6.8 diff --git a/src/BootstrapBlazor/Utils/Utility.cs b/src/BootstrapBlazor/Utils/Utility.cs index 1bef8c38c03c4df7e5d394d256cd46fe37d53f72..9682571dbae4270e3cd2a6052021a0f606ea79ef 100644 --- a/src/BootstrapBlazor/Utils/Utility.cs +++ b/src/BootstrapBlazor/Utils/Utility.cs @@ -265,10 +265,7 @@ public static class Utility var fieldType = item.PropertyType; var fieldName = item.GetFieldName(); var displayName = item.GetDisplayName() ?? GetDisplayName(model, fieldName); - var fieldValue = GenerateValue(model, fieldName); - var valueExpression = GenerateValueExpression(model, fieldName, fieldType); - var type = (Nullable.GetUnderlyingType(fieldType) ?? fieldType); if (type == typeof(bool) || fieldValue?.GetType() == typeof(bool)) { @@ -279,14 +276,22 @@ public static class Utility builder.AddAttribute(4, nameof(Switch.ShowLabelTooltip), item.ShowLabelTooltip); builder.CloseComponent(); } + else if (item.ComponentType == typeof(Textarea)) + { + builder.OpenComponent(0, typeof(Textarea)); + builder.AddAttribute(1, nameof(Textarea.DisplayText), displayName); + builder.AddAttribute(2, nameof(Textarea.Value), fieldValue); + builder.AddAttribute(3, nameof(Textarea.ShowLabelTooltip), item.ShowLabelTooltip); + builder.AddAttribute(4, "readonly", true); + builder.CloseComponent(); + } else { builder.OpenComponent(0, typeof(Display<>).MakeGenericType(fieldType)); builder.AddAttribute(1, nameof(Display.DisplayText), displayName); builder.AddAttribute(2, nameof(Display.Value), fieldValue); - builder.AddAttribute(3, nameof(Display.ValueExpression), valueExpression); - builder.AddAttribute(4, nameof(Display.LookUpServiceKey), item.LookUpServiceKey); - builder.AddAttribute(5, nameof(Display.ShowLabelTooltip), item.ShowLabelTooltip); + builder.AddAttribute(3, nameof(Display.LookUpServiceKey), item.LookUpServiceKey); + builder.AddAttribute(4, nameof(Display.ShowLabelTooltip), item.ShowLabelTooltip); builder.CloseComponent(); } }